From 8741b8bb1d75b33643319a115ba89881f6b1b2cd Mon Sep 17 00:00:00 2001 From: bbb169 <827088092@qq.com> Date: Wed, 16 Aug 2023 18:19:52 +0800 Subject: [PATCH] fix: popup shift to left in the first render when set strech property to trigger --- src/index.tsx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/index.tsx b/src/index.tsx index ed88b2c4..298eae7a 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -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); } },