Fail the header drawer pan at touch-down outside the header strip
The drawer gesture's 40px-wide left-edge hitSlop spans the full screen height; its y-position check only ran in onEnd, after the pan had already activated and stolen the touch from the native back-swipe recognizer. Fail the gesture immediately when the touch starts below the header so left-edge back-swipes work everywhere else. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
9ac1d7f398
commit
90ea2d376a
1 file changed
+10
@@ -276,6 +276,16 @@ export const ThreadDetailScreen = memo(function ThreadDetailScreen(props: Thread
|
||||
.hitSlop({ left: 0, width: 40 })
|
||||
.activeOffsetX([10, 999])
|
||||
.failOffsetY([-24, 24])
|
||||
// Fail at touch-down for anything below the header strip. Activating
|
||||
// there (the y check in onEnd fires too late to matter) swallows the
|
||||
// left-edge touch and blocks the native back-swipe along the whole
|
||||
// screen height.
|
||||
.onTouchesDown((event, stateManager) => {
|
||||
const touchY = event.allTouches[0]?.y ?? Number.POSITIVE_INFINITY;
|
||||
if (touchY >= drawerGestureThreshold) {
|
||||
stateManager.fail();
|
||||
}
|
||||
})
|
||||
.onEnd((event) => {
|
||||
const translationX = Math.max(event.translationX, 0);
|
||||
if (event.y < drawerGestureThreshold && translationX > 56) {
|
||||
|
||||
Reference in new issue
Block a user