Repository navigation
Revert: [web] Keep the keyboard up during an iOS caret drag - #190926
Merged
auto-submit[bot] merged 1 commit intoAug 11, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request removes the iOS Safari-specific transient blur deferral logic from ViewFocusBinding and DefaultTextEditingStrategy, along with associated timers, helper methods, and tests. I have no feedback to provide as there are no review comments.
jtmcdole
approved these changes
Aug 11, 2026
This was referenced Aug 12, 2026
10 tasks done
pull Bot
pushed a commit
to edisplay/flutter
that referenced
this pull request
Sep 18, 2026
…#190942) Fixes flutter#189744 **Reland of flutter#190014, reverted in flutter#190926.** Cause: three of the new tests dispatch a real input.blur(), but desktop Safari uses SafariDesktopTextEditingStrategy, which does not subscribe to blur, so handleBlur never ran. Real iOS does subscribe, so the fix itself was unaffected. Delta: one test-only commit adding skip: isSafari to those three tests. No production change. **Problem** On iOS 27, long-press-dragging the selection caret in a Web TextField dismisses the keyboard mid-gesture. WebKit transiently blurs the hidden input with a null relatedTarget while the document keeps focus, then refocuses it a frame later,and the engine reacted to that blink on two listeners that each tore the input down. A plain input ignores the same blur, so the cause is Flutter's reaction, not a WebKit limitation. **Fix** On iOS both listeners now defer their teardown by 100ms and cancel it if the input refocuses, mirroring the existing flutter#155265 deferred close. Done and tap-away never refocus so they still close, and the deferral is narrowed to the exact drag signature so every other focus transition is unaffected. **Demo** Before: https://flutter-demo-52-before.web.app/ (keyboard dismisses mid caret drag) After: https://flutter-demo-52-after.web.app/ (keyboard stays up) Repro on iOS 27 Safari: tap the field to raise the keyboard, then long-press and drag the selection caret. Before dismisses; after stays up. Done and tap-away still dismiss.
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.
Reverts: [web] Keep the keyboard up during an iOS caret drag
Initiated by: @jtmcdole
Reason for reverting:
Original PR Author: @flutter-zl
Reviewed By: @Renzo-Olivares
The original PR description is provided below:
Fixes #189744
Problem
On iOS 27, long-press-dragging the selection caret in a Web TextField dismisses the keyboard mid-gesture. WebKit transiently blurs the hidden input with a null relatedTarget while the document keeps focus, then refocuses it a frame later,and the engine reacted to that blink on two listeners that each tore the input down. A plain input ignores the same blur, so the cause is Flutter's reaction, not a WebKit limitation.
Fix
On iOS both listeners now defer their teardown by 100ms and cancel it if the input refocuses, mirroring the existing #155265 deferred close. Done and tap-away never refocus so they still close, and the deferral is narrowed to the exact drag signature so every other focus transition is unaffected.
Demo
Before: https://flutter-demo-52-before.web.app (keyboard dismisses mid caret drag)
After: https://flutter-demo-52-after.web.app (keyboard stays up)
Repro on iOS 27 Safari: tap the field to raise the keyboard, then long-press and drag the selection caret. Before dismisses; after stays up. Done and tap-away still dismiss.