fix: Match mobile-web :hover behavior on touch#9793
Draft
MatiPl01 wants to merge 4 commits into
Draft
Conversation
9157a9d to
bf6fed5
Compare
28af0ad to
3cc7b55
Compare
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.
Touch
:hovernow depends only on the touch-down and release locations, matching how mobile Chromium commits hover. A touch-down hovers the views on its hit branch and unhovers everything else (a touch on blank space clears all); moves and scrolls in between change nothing; when the first finger lifts, each hovered view stays hovered only if the finger is still over it. A window-level cancel is a system interruption, not a release, so it keeps the hover. This replaces the slop-based dismissal, which dropped:hoveron any movement even when the finger released back over the view.Only the first finger drives the touch selectors, matching the web's single active pointer: later fingers are ignored for the whole gesture, a release can arrive as an early pointer-up while other fingers stay down, and a finger that inherits the recycled pointer id mid-gesture cannot re-trigger anything. On iOS,
:active/:active-deepestrecognizers share a primary-touch token for the same guarantee.Android keeps the tag-based hit-testing (svg elements included) and the per-host fallback, so the same rules apply inside Modal/Dialog windows; there a cancel drops the hover, since the real release is never delivered.
Verified on an Android emulator and the iOS simulator (release builds): sticky tap, blank-space clear, drag-off release, scroll ending off the view (drops), scroll ending over the view (keeps), svg overlap, and the
:active/:active-deepestpress cases.