Skip to content

Commit

Permalink
PR from alexkatz#112
Browse files Browse the repository at this point in the history
  • Loading branch information
Andriy Malivanchuk committed Jun 8, 2021
1 parent f9e3a84 commit 9db6333
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Popover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,9 @@ export const Popover = forwardRef<HTMLElement, PopoverProps>(
);

const handleWindowResize = useCallback(() => {
window.requestAnimationFrame(() => positionPopover());
if(childRef?.current){
window.requestAnimationFrame(() => positionPopover());
}
}, [positionPopover]);

useEffect(() => {
Expand Down

0 comments on commit 9db6333

Please sign in to comment.