-
-
Notifications
You must be signed in to change notification settings - Fork 1k
[Web] Change shouldBeCancelledByOther
to respect blocksExternalGesture
#3429
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
Conversation
src/web/tools/InteractionManager.ts
Outdated
if ( | ||
this.blocksHandlersRelations | ||
.get(handler.handlerTag) | ||
?.includes(otherHandler.handlerTag) | ||
) { | ||
return false; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this allow for the situation where both of the gestures are active?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, depends how do you understand active
. If by having state
set to 4
then yes, it is possible due to current Gesture Handler implementation.
But looking at the example code, NativeViewGestureHandler
won't send event in active state
since tryActivate
for this handler will be called only once and it will be marked as awaitingHandler
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it possible to do the reverse? I.e. when a handler tries to activate, check if there's already an active one that is blocking the current one. If so, cancel/fail instead of activating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I recall correctly there were some complications with this approach, but I'll double-check that
I've changed the approach and when checking I've also checked when these changes were introduced and tracked it down to #2788. I've checked the example and |
Description
While checking possibilities of blocking
FlatList
with gestures usingblocksExternalHandler
, I've found out that even thoughFlatList
doesn't scroll,Tap
fails. Turns out thatshouldBeCancelledByOther
method doesn't respect blocking relation. I think that if handler explicitly blocks other handler, it shouldn't be possible for it to be blocked by handler that it should block.Test plan
Tested on the following code: