Fix PopoverPanel focus issue

Fixes #20
This commit is contained in:
Ryan Gossiaux
2021-12-16 23:06:36 -08:00
parent f5130c6cc1
commit 6076a60837

View File

@@ -40,7 +40,7 @@
? $openClosedState === State.Open
: $api.popoverState === PopoverStates.Open;
onMount(() => {
$: (() => {
if (!focus) return;
if ($api.popoverState !== PopoverStates.Open) return;
if (!$api.panel) return;
@@ -49,7 +49,7 @@
if ($api.panel?.contains(activeElement)) return; // Already focused within Dialog
focusIn($api.panel!, Focus.First);
});
})();
function handleWindowKeydown(event: KeyboardEvent) {
if ($api.popoverState !== PopoverStates.Open) return;