Ensure Popover doesn't crash when focus is going to window (#2019)
* ensure Popover doesn't crash when `focus` is going to `window` * update changelog
This commit is contained in:
@@ -281,6 +281,7 @@ let PopoverRoot = forwardRefWithAs(function Popover<
|
||||
if (isFocusWithinPopoverGroup()) return
|
||||
if (!button) return
|
||||
if (!panel) return
|
||||
if (event.target === window) return
|
||||
if (beforePanelSentinel.current?.contains?.(event.target as HTMLElement)) return
|
||||
if (afterPanelSentinel.current?.contains?.(event.target as HTMLElement)) return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user