Repository navigation
[web] Don't remove the a11y placeholder mid-gesture when semantics turns on - #194393
auto-submit[bot] merged 3 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request replaces the immediate disposal of semantics placeholders with a deferred retirement mechanism. On mobile platforms, if a touch or pointer gesture is in progress, placeholder removal is scheduled to occur only after the gesture ends, preventing lost pointer events. On desktop, placeholders are removed immediately. Feedback suggests resetting the _schedulePlaceholderRemoval flag to false once placeholders are removed to ensure proper state hygiene.
flutter-zl
left a comment
There was a problem hiding this comment.
LGTM. Verified on Android Chrome with a demo that calls ensureSemantics() mid-drag:
- Before (https://flutter-demo-03-before.web.app): the placeholder is removed during the drag and the list stops scrolling.
- After (https://flutter-demo-03-after.web.app): the placeholder is removed after the finger lifts and the drag scrolls normally.
|
autosubmit label was removed for flutter/flutter/194393, because - The status or check suite Mac_arm64_verify_binaries has failed. Please fix the issues identified (or deflake) before re-applying this label.
|
|
autosubmit label was removed for flutter/flutter/194393, because - The status or check suite Dashboard Checks has failed. Please fix the issues identified (or deflake) before re-applying this label. |
…rns on (flutter#194393) Follow-up to flutter#194109. When the app enables semantics itself, `didReceiveSemanticsUpdate` removed the placeholder right away. If a drag that started on the placeholder was still going on, removing its target could lose the drag's `pointerup`, which is the same failure as flutter#194104. This PR replaces `SemanticsHelper.dispose()` with `retirePlaceholders()`. On mobile, `MobileSemanticsEnabler` tracks whether a pointer or touch gesture is in progress. If one is, removal waits for the next `pointerup`/`pointercancel`/`touchend`/`touchcancel`/`click`, the same way the 20-attempt path already does. Otherwise it removes the placeholder immediately. Desktop is unchanged, since its placeholder is offscreen and can't be the target of a gesture. Part of flutter#194104
Follow-up to #194109.
When the app enables semantics itself,
didReceiveSemanticsUpdateremoved the placeholder right away. If a drag that started on the placeholder was still going on, removing its target could lose the drag'spointerup, which is the same failure as #194104.This PR replaces
SemanticsHelper.dispose()withretirePlaceholders(). On mobile,MobileSemanticsEnablertracks whether a pointer or touch gesture is in progress. If one is, removal waits for the nextpointerup/pointercancel/touchend/touchcancel/click, the same way the 20-attempt path already does. Otherwise it removes the placeholder immediately. Desktop is unchanged, since its placeholder is offscreen and can't be the target of a gesture.Part of #194104