diff --git a/.changeset/ten-fireants-try.md b/.changeset/ten-fireants-try.md new file mode 100644 index 000000000..fefaa2ddf --- /dev/null +++ b/.changeset/ten-fireants-try.md @@ -0,0 +1,5 @@ +--- +"@huntabyte/primitives": patch +--- + +Fix menubar kbd navigation bug diff --git a/src/lib/primitives/hover-card/components/HoverCard.svelte b/src/lib/primitives/hover-card/components/HoverCard.svelte index 3d1b6eda9..1db320dc4 100644 --- a/src/lib/primitives/hover-card/components/HoverCard.svelte +++ b/src/lib/primitives/hover-card/components/HoverCard.svelte @@ -6,8 +6,8 @@ export let positioning: $$Props["positioning"] = undefined; export let open: $$Props["open"] = undefined; export let onOpenChange: $$Props["onOpenChange"] = undefined; - export let openDelay: $$Props["openDelay"] = undefined; - export let closeDelay: $$Props["closeDelay"] = undefined; + export let openDelay: $$Props["openDelay"] = 700; + export let closeDelay: $$Props["closeDelay"] = 300; export let closeOnOutsideClick: $$Props["closeOnOutsideClick"] = undefined; export let closeOnEscape: $$Props["closeOnEscape"] = undefined; export let arrowSize: $$Props["arrowSize"] = undefined; diff --git a/src/lib/primitives/menubar/components/MenubarMenu.svelte b/src/lib/primitives/menubar/components/MenubarMenu.svelte index 9c7b632ae..2bd655cc0 100644 --- a/src/lib/primitives/menubar/components/MenubarMenu.svelte +++ b/src/lib/primitives/menubar/components/MenubarMenu.svelte @@ -6,7 +6,6 @@ export let closeOnOutsideClick: $$Props["closeOnOutsideClick"] = undefined; export let closeOnEscape: $$Props["closeOnEscape"] = undefined; export let portal: $$Props["portal"] = undefined; - export let forceVisible: $$Props["forceVisible"] = undefined; export let open: $$Props["open"] = undefined; export let onOpenChange: $$Props["onOpenChange"] = undefined; export let preventScroll: $$Props["preventScroll"] = undefined; @@ -28,8 +27,8 @@ loop, dir, onOpenChange: ({ next }) => { - open = next; onOpenChange?.(next); + open = next; return next; } }); @@ -38,7 +37,6 @@ $: updateOption("closeOnOutsideClick", closeOnOutsideClick); $: updateOption("closeOnEscape", closeOnEscape); $: updateOption("portal", portal); - $: updateOption("forceVisible", forceVisible); $: updateOption("preventScroll", preventScroll); $: updateOption("arrowSize", arrowSize); $: updateOption("positioning", positioning); diff --git a/src/lib/primitives/menubar/ctx.ts b/src/lib/primitives/menubar/ctx.ts index 9408fff7f..972c375ba 100644 --- a/src/lib/primitives/menubar/ctx.ts +++ b/src/lib/primitives/menubar/ctx.ts @@ -63,7 +63,7 @@ function setMenu(props: CreateMenubarMenuProps) { builders: { createMenu } } = get(); - const menu = createMenu({ ...removeUndefined(props), forceVisible: false }); + const menu = createMenu(removeUndefined(props)); setContext(MENU_NAME, menu); return { ...menu, diff --git a/src/routes/+page.svelte b/src/routes/+page.svelte index cea72fbc1..1363bed08 100644 --- a/src/routes/+page.svelte +++ b/src/routes/+page.svelte @@ -1,5 +1,6 @@