add closeOnClick slot prop to ActionMenu
This commit is contained in:
parent
7f70fa3c0b
commit
2b394eab25
|
@ -16,6 +16,11 @@
|
|||
export const show = () => {
|
||||
dropdown.show()
|
||||
}
|
||||
|
||||
const closeOnClickWrapper = (cb) => {
|
||||
dropdown.hide()
|
||||
cb()
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="contents" use:getAnchor on:click={dropdown.show}>
|
||||
|
@ -23,7 +28,7 @@
|
|||
</div>
|
||||
<Popover bind:this={dropdown} {anchor} align="left">
|
||||
<Menu>
|
||||
<slot />
|
||||
<slot closeOnClick={closeOnClickWrapper} />
|
||||
</Menu>
|
||||
</Popover>
|
||||
|
||||
|
|
Loading…
Reference in New Issue