Fix state manager on unregistered gestures#3913
Merged
akwasniewski merged 10 commits intonextfrom Jan 30, 2026
Merged
Conversation
m-bert
reviewed
Jan 9, 2026
Collaborator
m-bert
left a comment
There was a problem hiding this comment.
As said in the first comment, I'm not a big fan of ForManual suffix. I think we could either use overloading (where possible) or add more descriptive suffix.
added 2 commits
January 13, 2026 08:22
j-piasecki
reviewed
Jan 19, 2026
Comment on lines
+210
to
+222
| private fun findGestureHandlerRootView(): RNGestureHandlerRootView? { | ||
| var parent: ViewParent? = this.parent | ||
| var gestureHandlerRootView: RNGestureHandlerRootView? = null | ||
|
|
||
| while (parent != null) { | ||
| if (parent is RNGestureHandlerRootView) { | ||
| gestureHandlerRootView = parent | ||
| } | ||
| parent = parent.parent | ||
| } | ||
|
|
||
| return gestureHandlerRootView | ||
| } |
Member
There was a problem hiding this comment.
Don't we have this exact method already defined somewhere? Maybe it's worth moving it to some utils, or making it an extension on View?
Contributor
Author
There was a problem hiding this comment.
Sure, I moved it to be companion object for the rootView in 8a4ffc9. Let me know what you think.
Member
There was a problem hiding this comment.
Hmm, I'm not sure whether this.findGestureHandlerRootView()?... wouldn't have been cleaner, but I'll leave the final decision to you. Both work for me.
j-piasecki
approved these changes
Jan 29, 2026
m-bert
approved these changes
Jan 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The new
StateManageris global and givenhandlerTagit can manually set the states of an arbitrary gesture. This causes errors, when the gesture, which state is being set, has not been yet recorded in the orchestrator. Recording gestures in the orchestrator on android is done lazily, thus if it never received touches it is not recorded.It also adds explicit error when trying to manually handled a gesture not attached to any detector on all platforms.
Test plan
Tested on the following example
Details