Add use= support to Popover
Fixes #21 Not sure it's worth doing this component by component instead of figuring out <Render> first but w/e
This commit is contained in:
@@ -52,6 +52,8 @@
|
||||
import type { PopoverGroupContext } from "./PopoverGroup.svelte";
|
||||
import { getContext, setContext, onMount } from "svelte";
|
||||
import { writable, Writable } from "svelte/store";
|
||||
import { ActionArray, useActions } from "$lib/hooks/use-actions";
|
||||
export let use: ActionArray = [];
|
||||
const buttonId = `headlessui-popover-button-${useId()}`;
|
||||
const panelId = `headlessui-popover-panel-${useId()}`;
|
||||
|
||||
@@ -164,6 +166,6 @@
|
||||
</script>
|
||||
|
||||
<svelte:window on:focus|capture={handleFocus} on:mousedown={handleMousedown} />
|
||||
<div {...$$restProps}>
|
||||
<div use:useActions={use} {...$$restProps}>
|
||||
<slot open={popoverState === PopoverStates.Open} close={$api.close} />
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user