Skip to content

Commit fa211a0

Browse files
committed
fix: prevent swipe back gesture during push/pop transitions (#609)
This fix resolves a race condition where swiping back during a push transition caused the app to freeze. The issue was particularly severe when using historySyncPlugin, causing complete UI lockup. The root cause was that the swipe gesture listener on the edge element did not check if the activity was in an active transition state before starting the swipe. This allowed users to initiate a swipe gesture while a new activity was sliding in (enter-active) or sliding out (exit-active), creating conflicting animations. Changes: - Added transition state check in useStyleEffectSwipeBack's onTouchStart - Swipe gestures are now blocked when activity is in "enter-active" or "exit-active" transition states - Only allows swipe to start when activity is in stable state ("enter-done" or "exit-done") Fixes #609 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent 1e5aae3 commit fa211a0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

extensions/react-ui-core/src/useStyleEffectSwipeBack.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,12 @@ export function useStyleEffectSwipeBack({
208208
}
209209

210210
const onTouchStart = (e: TouchEvent) => {
211+
// Prevent swipe gesture from starting during push/pop transitions
212+
const transitionState = getActivityTransitionState();
213+
if (transitionState === "enter-active" || transitionState === "exit-active") {
214+
return;
215+
}
216+
211217
const { activeElement } = document as any;
212218

213219
activeElement?.blur?.();

0 commit comments

Comments
 (0)