.com] Autofill is no longer working after using the clear form option
(Toolkit :: Form Autofill, defect, P3)
(Reporter: alin.ilea, Unassigned)
(Blocks 2 open bugs,
847.34 KB, video/mp4
36.36 KB, image/png
Nightly 99.a1, Beta 98 and Release 97
extensions.formautofill.addresses.enabled - true
extensions.formautofill.addresses.supported to "detect"
download latest Firefox Nightly with region locale
have a complete address already saved in about:preferences#privacy
Steps to reproduce:
- Reach the address form on apple.com
- Using the autofill feature, select 1 saved address entry.
- Click in any auto-filled field in order to clear the form by using the autofill dropdown option.
- Autofill should work accordingly after clearing the form using the "Clear Form" option.
- The preview should be compatible with the field placeholders without overlapping each other.
- Autofill is no longer working after using the clear form option.
- Address autofill preview overlaps with field placeholder (see comment 1).
Reproducible on Chrome: 1. No, 2. Yes
Please let me know if a separate bug is needed for the second issue (Address autofill preview overlaps with field placeholder) and I'll file a new one for that.
1 year ago
1 year ago
1 year ago
Ah okay, I think I know what's going on. So before filling the form, the form has a City and State field. After filling however, these two fields get condensed into one select element, based on the ZIP Code field. When we go to clear the form, we appear to clear everything except this combined City, State select element. However the selected element in first in the list, so we don't reset the select element. The element in order to "correctly" reset the form is the last element in the select element, an option with the "Other" value. If one selects the "other" value, then the select element separates itself back into two separate city and state inputs and allows autofill to occur again.
Here's why the autocomplete dropdown doesn't appear after clearing: the current form has already been populated and the field is not an empty credit card field. Since there is still user filled data in the form, we don't clear the
filledRecordGUID which causes us to go down the form history branch, which prevents the autocomplete results from appearing as expected.
I think there are some other issues with our autocomplete handling on this page however, we seem to call _fillFromAutocompleteRow() when we clear the form, which doesn't make a lot of sense to me. Clearing the form causes the "FormAutoComplete:HandleEnter" message to be sent but this appears to be expected due to clear form being an option in the autocomplete dropdown menu (I think? I'm not entirely sure about this anymore). I guess the more unexpected part is, why is the "autocomplete-will-enter-text" topic being observed when a form is being cleared? Hmm, this previously stated pattern seems to happen even on sites where the clear form functionality works as expected (i.e. https://mozilla.github.io/form-fill-examples/basic.html)...so I don't think that's an additional culprit.
Something else I noticed is that we're not clearing the styles on the Country/Region input after clearing the form. This, to me, implies we're not changing the state of this field correctly and that might be what's causing this issue. It's odd that splitting the City and State fields causes autofill to work again (sometimes, the form can get into an odd state still) but the Country/Region field is still highlighted as if it was autofilled until one previews another autocomplete result.
1 year ago