We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9238fb6 commit 75a2456Copy full SHA for 75a2456
src/Dialog/index.tsx
@@ -136,9 +136,6 @@ export default function Dialog(props: IDialogChildProps) {
136
useEffect(() => {
137
if (visible) {
138
setAnimatedVisible(true);
139
- scrollLocker?.lock();
140
-
141
- return scrollLocker?.unLock;
142
}
143
return () => {};
144
}, [visible]);
@@ -151,6 +148,14 @@ export default function Dialog(props: IDialogChildProps) {
151
148
[],
152
149
);
153
150
+ useEffect(() => {
+ if (animatedVisible) {
+ scrollLocker?.lock();
154
+ return scrollLocker?.unLock;
155
+ }
156
+ return () => {};
157
+ }, [animatedVisible]);
158
+
159
// ========================= Render =========================
160
return (
161
<div className={`${prefixCls}-root`}>
0 commit comments