Skip to content

Commit 93a0d28

Browse files
fix: select popover opens properly on polyfill
1 parent 6cc8539 commit 93a0d28

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

packages/kit-headless/src/components/popover/popover-trigger.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,13 @@ export const PopoverTrigger = component$<PopoverTriggerProps>(
148148
}
149149

150150
// for the first click, we need to programmatically open the popover. The spec toggles the popover on click anyways.
151-
context.panelRef?.value?.togglePopover();
151+
if (!isSupportedSig.value) {
152+
if (!context.isOpenSig.value) {
153+
context.panelRef?.value?.showPopover();
154+
} else {
155+
context.panelRef?.value?.hidePopover();
156+
}
157+
}
152158
});
153159

154160
const handlePointerOver$ = $(async () => {

packages/kit-headless/src/components/select/select-popover.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ export const SelectPopover = component$<PropsOf<typeof PopoverRoot>>((props) =>
2727

2828
if (!initialLoadSig.value) {
2929
if (context.isListboxOpenSig.value) {
30-
await showPopover();
30+
showPopover();
3131
} else {
32-
await hidePopover();
32+
hidePopover();
3333
}
3434
}
3535
});

0 commit comments

Comments
 (0)