@trackunit/react-drawer 2.6.71 → 2.6.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs.js +13 -0
- package/index.esm.js +13 -0
- package/migrations/entry.js.map +1 -0
- package/package.json +1 -1
package/index.cjs.js
CHANGED
|
@@ -364,6 +364,19 @@ const Drawer = ({ isOpen, variant, trapFocus, position, floatingUi, children, "d
|
|
|
364
364
|
});
|
|
365
365
|
return () => cancelAnimationFrame(rafId);
|
|
366
366
|
}, [drawerState.mode, drawerState.shouldRender]);
|
|
367
|
+
// If transitionend is suppressed while a CSS animation is reported as running
|
|
368
|
+
// (Playwright/iframe), unmount after the motion duration so close cannot stick.
|
|
369
|
+
react.useEffect(() => {
|
|
370
|
+
if (drawerState.mode !== "closed" || !drawerState.shouldRender) {
|
|
371
|
+
return;
|
|
372
|
+
}
|
|
373
|
+
const timeoutId = window.setTimeout(() => {
|
|
374
|
+
if (!isOpenRef.current) {
|
|
375
|
+
dispatch({ type: "transitionEnd" });
|
|
376
|
+
}
|
|
377
|
+
}, DRAWER_TRANSITION_DURATION_MS + 50);
|
|
378
|
+
return () => window.clearTimeout(timeoutId);
|
|
379
|
+
}, [drawerState.mode, drawerState.shouldRender]);
|
|
367
380
|
// If transitionend is suppressed, settle enter after the motion duration so focus
|
|
368
381
|
// still activates. Do not use a zero-delay rAF here — getAnimations() can be empty
|
|
369
382
|
// for a frame before the CSS transition starts, which would focus mid-slide and
|
package/index.esm.js
CHANGED
|
@@ -362,6 +362,19 @@ const Drawer = ({ isOpen, variant, trapFocus, position, floatingUi, children, "d
|
|
|
362
362
|
});
|
|
363
363
|
return () => cancelAnimationFrame(rafId);
|
|
364
364
|
}, [drawerState.mode, drawerState.shouldRender]);
|
|
365
|
+
// If transitionend is suppressed while a CSS animation is reported as running
|
|
366
|
+
// (Playwright/iframe), unmount after the motion duration so close cannot stick.
|
|
367
|
+
useEffect(() => {
|
|
368
|
+
if (drawerState.mode !== "closed" || !drawerState.shouldRender) {
|
|
369
|
+
return;
|
|
370
|
+
}
|
|
371
|
+
const timeoutId = window.setTimeout(() => {
|
|
372
|
+
if (!isOpenRef.current) {
|
|
373
|
+
dispatch({ type: "transitionEnd" });
|
|
374
|
+
}
|
|
375
|
+
}, DRAWER_TRANSITION_DURATION_MS + 50);
|
|
376
|
+
return () => window.clearTimeout(timeoutId);
|
|
377
|
+
}, [drawerState.mode, drawerState.shouldRender]);
|
|
365
378
|
// If transitionend is suppressed, settle enter after the motion duration so focus
|
|
366
379
|
// still activates. Do not use a zero-delay rAF here — getAnimations() can be empty
|
|
367
380
|
// for a frame before the CSS transition starts, which would focus mid-slide and
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry.js","sourceRoot":"","sources":["../../../../../libs/react/drawer/migrations/entry.ts"],"names":[],"mappings":"","sourcesContent":["export {};\n"]}
|