@trackunit/react-drawer 2.6.70 → 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 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"]}
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@trackunit/react-drawer",
3
- "version": "2.6.70",
3
+ "version": "2.6.72",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {
7
7
  "node": ">=24.x"
8
8
  },
9
9
  "dependencies": {
10
- "@trackunit/react-components": "2.13.23",
10
+ "@trackunit/react-components": "2.13.24",
11
11
  "@trackunit/css-class-variance-utilities": "2.0.14",
12
- "@trackunit/i18n-library-translation": "2.4.62",
12
+ "@trackunit/i18n-library-translation": "2.4.63",
13
13
  "@floating-ui/react": "^0.26.25",
14
14
  "tailwind-merge": "^2.0.0"
15
15
  },