This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] Fix for Safari autofill flickering bug #42830
Merged
Merged
Conversation
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
Contributor
|
Change looks good to me! Let's add some tests and this should be good to go. |
Contributor
Author
All done! Requesting re-review |
mdebbar
approved these changes
Jun 16, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 16, 2023
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
Jun 17, 2023
…129047) flutter/engine@7483c8a...7ffa135 2023-06-16 [email protected] Roll Skia from 01f3be45e0d6 to 64fa632d3b01 (3 revisions) (flutter/engine#42937) 2023-06-16 [email protected] [web] Fix for Safari autofill flickering bug (flutter/engine#42830) 2023-06-16 [email protected] [Impeller] correct default PSO pixel format and sample count. (flutter/engine#42902) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
autosubmit
Merge PR when tree becomes green via auto submit App
platform-web
Code specifically for the web engine
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.
Safari web autofill has an issue where the autofill dialog flickers and doesn't completely render and allow users to fill any forms.
This is caused by a collision between default browser behavior on the
pointerdownevent and the programatic focusing of our inputs.Problem
When we click into an input, the element is created, placed, and (explicitly) focused. However, all of this is done before the
pointerdownevent can finish. Since allpointerdownelements target theflutter-view(formerlyflt-glass-pane), default browser behavior is to trigger ablurevent since the target doesn't match what's currently focused, which is the input element. This doesn't manifest as an issue in most text editing use cases because we listen forblurevents on theinputand callfocus(). However, in Safari, this near-instant focus/blur results in the disappearance of the autofill popup.The current chain of events looks like:
pointerdownevent starts -> input is created + focused ->pointerdownevent ends, and triggers ablur-> input refocuses onblurSolution
This change ensures that we don't focus the input until after the
pointerdownevent concludes, thus preventing any rapid-fireblurevent from being emitted. We do this via wrapping the focus logic within a zero-duration Timer.The new chain of events looks like:
pointerdownevent starts ->pointerdownevent ends -> input is created + focusedAlternative approach
Note: Another option was to call
preventDefault()on thepointerdownevent to prevent theblurfrom occurring that way. There may be unintended side effects from that approach, especially as it relates to platform views. The surface area of the chosen approach is much more contained and should result in no side effects outside of Safari Desktop's text editing strategy.Fixes flutter/flutter#127960
Pre-launch Checklist
///).