Workaround tabIndex=-1 added to document body by SvelteKit
This ends up producing a lot of extra focus events that normally would not exist. Fixes #36 Fixes #39
This commit is contained in:
@@ -137,7 +137,11 @@
|
||||
onMount(() => registerPopover?.(registerBag));
|
||||
|
||||
// Handle focus out
|
||||
function handleFocus() {
|
||||
function handleFocus(event: FocusEvent) {
|
||||
if (event.target === window.document.body) {
|
||||
// Workaround for a SvelteKit issue: https://github.com/sveltejs/kit/issues/3501
|
||||
return;
|
||||
}
|
||||
if (popoverState !== PopoverStates.Open) return;
|
||||
if (isFocusWithinPopoverGroup()) return;
|
||||
if (!button) return;
|
||||
|
||||
Reference in New Issue
Block a user