Skip to content

Commit

Permalink
fix: popup shift to left in the first render when set strech property…
Browse files Browse the repository at this point in the history
… to trigger
  • Loading branch information
bbb169 committed Aug 21, 2023
1 parent 3e019ed commit 8741b8b
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,13 @@ export function generateTrigger(
useLayoutEffect(
(firstMount) => {
if (!firstMount || mergedOpen) {
if (stretch) {
// delay setting makes it calculate
setTimeout(() => {
setInMotion(true);
}, 0);
return;
}
setInMotion(true);
}
},
Expand Down

0 comments on commit 8741b8b

Please sign in to comment.