This repository was archived by the owner on Feb 25, 2025. It is now read-only.
[web] - Fix for Safari partially autofilling form #43058
Merged
auto-submit[bot] merged 5 commits intoflutter:mainfrom Jun 23, 2023
Merged
[web] - Fix for Safari partially autofilling form #43058auto-submit[bot] merged 5 commits intoflutter:mainfrom
auto-submit[bot] merged 5 commits intoflutter:mainfrom
Conversation
mdebbar
reviewed
Jun 23, 2023
| // We need to explicitly disable pointer events on the form in Safari Desktop, | ||
| // so that we don't have pointer event collisions if users hover over or click | ||
| // into the invisible autofill elements within the form. | ||
| _hideAutofillElements(formElement, shouldDisablePointerEvents: isSafariDesktopStrategy); |
Contributor
There was a problem hiding this comment.
It's not clear to me why we are not passing shouldHideElement: !isSafariDesktopStrategy here.
Contributor
Author
There was a problem hiding this comment.
For the autofill to work, we only need the actual <input> elements visible for Safari and don't have to worry about the <form>.
As for why we need to disable pointer events here on an "invisible" form, Safari has this weird behavior where the <form> element still registers as the target, even if the input child has disabled pointer events. This doesn't occur on Chrome or Firefox from my testing.
Contributor
There was a problem hiding this comment.
Oh nvm. I didn't notice that this is for <form> while the other one below is for <input> elements.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Jun 23, 2023
fluttermirroringbot
pushed a commit
to flutter/flutter
that referenced
this pull request
Jun 23, 2023
flutter/engine@f8a39cb...eca910d 2023-06-23 110993981+htoor3@users.noreply.github.com [web] - Fix for Safari partially autofilling form (flutter/engine#43058) 2023-06-23 skia-flutter-autoroll@skia.org Roll ANGLE from bc2d5ed01f27 to 566f1ee4657c (1 revision) (flutter/engine#43154) 2023-06-23 skia-flutter-autoroll@skia.org Roll Skia from 7b6aae68a11f to d53ea1557b35 (1 revision) (flutter/engine#43153) 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 jsimmons@google.com,rmistry@google.com,zra@google.com 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
2 tasks
8 tasks
auto-submit bot
pushed a commit
that referenced
this pull request
Nov 13, 2023
In order to fix Safari autofill, we've had to give inactive elements non-zero size because Safari does not respect offscreen or 0-sized inputs, and this leads to broken autofill behavior (see: #43058). As part of these changes, we needed to disable pointer events for the parent `<form>` element so that we don't have pointer event collisions if users hover over or click into the invisible autofill elements within that form. This led to an issue where offsets weren't being calculated correctly for "active" inputs because they relied on pointer events bubbling up and being caught by the form. The fix is to explicitly set pointer events on the active inputs, so that we can correctly discern when our pointer event target is actually the input and correctly calculate the offsets. Fixes flutter/flutter#136006
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.

We have an issue where autofill in Safari Desktop is only partially autofilling the form. The only input that gets filled is the currently focused one.
This is happening for a couple of reasons:
The solution is to make sure we hide the inputs in the rest of the form from the users, without hiding it from Safari.
Fixes flutter/flutter#71275
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on [Discord].