-
Notifications
You must be signed in to change notification settings - Fork 6k
[web] - Fix for Safari partially autofilling form #43058
Conversation
| // 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); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not clear to me why we are not passing shouldHideElement: !isSafariDesktopStrategy here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh nvm. I didn't notice that this is for <form> while the other one below is for <input> elements.
mdebbar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…129451) flutter/engine@f8a39cb...eca910d 2023-06-23 [email protected] [web] - Fix for Safari partially autofilling form (flutter/engine#43058) 2023-06-23 [email protected] Roll ANGLE from bc2d5ed01f27 to 566f1ee4657c (1 revision) (flutter/engine#43154) 2023-06-23 [email protected] 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 [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
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

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].