Skip to content

Commit

Permalink
Popover: Check anchorDocument default view before removing events (#3…
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka authored and Vicente Canales committed Oct 27, 2021
1 parent 6d53474 commit a8aeda3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/popover/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,11 @@ const Popover = (
defaultView.cancelAnimationFrame( rafId );

if ( anchorDocument && anchorDocument !== ownerDocument ) {
anchorDocument.defaultView.removeEventListener(
anchorDocument.defaultView?.removeEventListener(
'resize',
refresh
);
anchorDocument.defaultView.removeEventListener(
anchorDocument.defaultView?.removeEventListener(
'scroll',
refresh,
true
Expand Down

0 comments on commit a8aeda3

Please sign in to comment.