fix: Clear touch :hover on a blank tap inside an Android Modal#9878
Merged
Conversation
a942db1 to
efea196
Compare
3342ada to
df014ea
Compare
efea196 to
1d101f7
Compare
df014ea to
a5819d9
Compare
558e6c8 to
23a0139
Compare
Observe each Modal/Dialog window's Window.Callback (fed by RN 0.86's public ExtraWindowEventListener) like the Activity window, so a blank-space press inside a modal clears :hover, matching iOS and mobile web. The hover coordinator becomes multi-window: observers are held weakly, the hit-test is rooted per-window, and a dismissed window clears only its own :hover. The listener is referenced reflectively (absent before RN 0.86, gated on IS_REACT_NATIVE_86_OR_NEWER) via a Proxy that handles equals/hashCode/toString so registering it into ReactContext's listener set cannot NPE; on older RN the per-view fallback stays.
a5819d9 to
e222b3e
Compare
tjzel
approved these changes
Jul 9, 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.
Clear touch
:hoveron a blank-space tap inside an Android Modal/Dialog - a separate OS window the Activity-window observer couldn't see. iOS already handles this via its key-window observer.Demo
A blank tap inside a
Modalclears a stuck:hoverOpen the modal, tap the box to hover it (turns orange), then tap the blank space.
Before, the blank tap inside the
Modal/Dialogwindow leaves:hoverstuck (the Activity-window observer is blind to that window).After, the blank tap clears it. Recorded on an Android emulator; the crosshair and yellow touch dot are the system pointer overlay showing each tap.
modal-hover-before.1.mp4
modal-hover-after.1.mp4
Example source