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