-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Android] Gesture incorrectly activated in scroll zone #2605
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
And concerning the gesture: I think I'll just tweak the |
Thanks, that's good to know. We have an existing issue to track this problem: #2399
Okay, sounds good! |
A bit more of updates. I think it's wrong, and we should only show the trace on definite gestures. There's a lot to grasp for rn in the MultiGesture, but I'm at 80% of certainty I get everything right. But while on that, I've seen this thing. It splits the windows in scroll/gesture parts, and does through "touchstart". The comment says about moving it. It could decrease the usage of imperative class-level flags. // enable/disable scrolling based on where the user clicks
// TODO: Could this be moved to onMoveShouldSetResponder?
document.body.addEventListener('touchstart', e => {
if (e?.touches.length > 0) {
const x = e.touches[0].clientX
const y = e.touches[0].clientY
this.clientStart = { x, y }
// disable gestures in the scroll zone on the right side of the screen
// disable scroll in the gesture zone on the left side of the screen
// (reverse in left-handed mode)
const viewport = viewportStore.getState()
const scrollZoneWidth = viewport.scrollZoneWidth
console.log("ScrollZoneWidth", scrollZoneWidth)
const isInGestureZone =
(this.leftHanded ? x > scrollZoneWidth : x < viewport.innerWidth - scrollZoneWidth) && y > TOOLBAR_HEIGHT
if (isInGestureZone && !props.shouldCancelGesture?.()) {
this.disableScroll = true
} else {
this.scrolling = true;
this.abandon = true
}
}
}) |
Hi, thanks for the update.
That's not true, TraceGesture is specifically only shown when a gesture is in progress: em/src/components/TraceGesture.tsx Line 56 in 8760cae
I'm not sure what you have in mind, but note that the logic already works correctly in Chrome and Safari. The question is, where does it behave differently on Android and why? I'm not comfortable changing the existing logic that works correctly on all platforms except Android.
I agree with you that mixing dom-level touchstart and PanResponder is not ideal. However, by altering something that is already working on most platforms you would be creating a significant risk of introducing a regression. I don't recommend you go down this path.
I don't quite understand what you're asking. If touchstart occurs on the left side of the screen, then scroll is disabled. If touchstart occurs on the right side of the screen, then the gesture is abandoned. In left-handed mode this is reversed. |
Android Chrome only.
Steps to Reproduce
Scroll by dragging in the scroll zone.
Current Behavior
Sometimes the TraceGesture is visible and a gesture is activated.
2024_11_21_19_18_01.mp4
Expected Behavior
Gestures should not be able to be activated when a touch starts in the scroll zone.
The text was updated successfully, but these errors were encountered: