Skip to content

Commit 8741b8b

Browse files
committed
fix: popup shift to left in the first render when set strech property to trigger
1 parent 3e019ed commit 8741b8b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/index.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,13 @@ export function generateTrigger(
345345
useLayoutEffect(
346346
(firstMount) => {
347347
if (!firstMount || mergedOpen) {
348+
if (stretch) {
349+
// delay setting makes it calculate
350+
setTimeout(() => {
351+
setInMotion(true);
352+
}, 0);
353+
return;
354+
}
348355
setInMotion(true);
349356
}
350357
},

0 commit comments

Comments
 (0)