@seed-design/stackflow 2.0.0 → 2.0.1
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.
|
@@ -22,7 +22,7 @@ var AppScreenRoot = (0, react.forwardRef)((props, ref) => {
|
|
|
22
22
|
});
|
|
23
23
|
(0, _stackflow_react_ui_core.usePreventTouchDuringTransition)({ ref: innerRef });
|
|
24
24
|
(0, react.useEffect)(() => {
|
|
25
|
-
if (api.activity?.transitionState === "enter-done") api.layerRef.current?.focus();
|
|
25
|
+
if (api.activity?.transitionState === "enter-done") api.layerRef.current?.focus({ preventScroll: true });
|
|
26
26
|
}, [api.activity?.transitionState, api.layerRef]);
|
|
27
27
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_useAppScreenContext.AppScreenProvider, {
|
|
28
28
|
value: api,
|
|
@@ -21,7 +21,7 @@ var AppScreenRoot = forwardRef((props, ref) => {
|
|
|
21
21
|
});
|
|
22
22
|
usePreventTouchDuringTransition({ ref: innerRef });
|
|
23
23
|
useEffect(() => {
|
|
24
|
-
if (api.activity?.transitionState === "enter-done") api.layerRef.current?.focus();
|
|
24
|
+
if (api.activity?.transitionState === "enter-done") api.layerRef.current?.focus({ preventScroll: true });
|
|
25
25
|
}, [api.activity?.transitionState, api.layerRef]);
|
|
26
26
|
return /* @__PURE__ */ jsx(AppScreenProvider, {
|
|
27
27
|
value: api,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seed-design/stackflow",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/daangn/seed-design.git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"clsx": "^2.1.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"@seed-design/css": "2.
|
|
40
|
+
"@seed-design/css": "2.2.1",
|
|
41
41
|
"@stackflow/core": "^1.2.0",
|
|
42
42
|
"@stackflow/react": "^1.5.1",
|
|
43
43
|
"@types/react": "^19.2.2",
|
|
@@ -40,7 +40,10 @@ export const AppScreenRoot = forwardRef<HTMLDivElement, AppScreenRootProps>((pro
|
|
|
40
40
|
// transitionState, so the effect won't re-fire.
|
|
41
41
|
useEffect(() => {
|
|
42
42
|
if (api.activity?.transitionState === "enter-done") {
|
|
43
|
-
|
|
43
|
+
// `preventScroll` so moving focus never scrolls an ancestor. The layer already fills
|
|
44
|
+
// the viewport, so the browser's default scroll-into-view is at best a no-op — and at
|
|
45
|
+
// worst a jarring jump when the app is embedded in a scrollable host (e.g. an iframe).
|
|
46
|
+
api.layerRef.current?.focus({ preventScroll: true });
|
|
44
47
|
}
|
|
45
48
|
}, [api.activity?.transitionState, api.layerRef]);
|
|
46
49
|
|