Skip to content

Commit

Permalink
fix(OverlayTrigger): position overlay properly when defaultShow set (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kyletsang committed Jul 16, 2023
1 parent 1b410eb commit 6bb3842
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/Overlay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,11 @@ const Overlay = React.forwardRef<HTMLElement, OverlayProps>(
});

useIsomorphicEffect(() => {
if (firstRenderedState) {
if (firstRenderedState && outerProps.target) {
// Must wait for target element to resolve before updating popper.
popperRef.current.scheduleUpdate?.();
}
}, [firstRenderedState]);
}, [firstRenderedState, outerProps.target]);

useEffect(() => {
if (!outerShow) {
Expand Down

0 comments on commit 6bb3842

Please sign in to comment.