Closed Bug 1755912 Opened 3 years ago Closed 1 year ago

[US][apple.com] Autofill is no longer working after using the clear form option

Categories

(Toolkit :: Form Autofill, defect, P3)

Desktop
All
defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox97 --- affected
firefox98 --- affected
firefox99 --- affected

People

(Reporter: ailea, Unassigned)

References

(Blocks 2 open bugs, )

Details

(Whiteboard: [fxcm-addr-compatibility])

Attachments

(2 files)

Attached video apple.com.mp4

Affected Versions:

Nightly 99.a1, Beta 98 and Release 97

Tested on:

MacOS 11
Windows 10

Preconditions:

browser.search.region US
extensions.formautofill.addresses.enabled - true
extensions.formautofill.addresses.supported to "detect"
extensions.formautofill.addresses.supportedCountries US,CA
download latest Firefox Nightly with region locale
have a complete address already saved in about:preferences#privacy

Steps to reproduce:

  1. Reach the address form on apple.com
  2. Using the autofill feature, select 1 saved address entry.
  3. Click in any auto-filled field in order to clear the form by using the autofill dropdown option.

Expected Results:

  1. Autofill should work accordingly after clearing the form using the "Clear Form" option.
  2. The preview should be compatible with the field placeholders without overlapping each other.

Actual Results:

  1. Autofill is no longer working after using the clear form option.
  2. Address autofill preview overlaps with field placeholder (see comment 1).

Notes:

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.

Flags: needinfo?(tgiles)

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.

Flags: needinfo?(tgiles)
Priority: -- → P3
Whiteboard: [fxcm-addr-compatibility]

I can't reproduce this issue, alin, could you help verify whether we autofill after clearing form? thank you!

Flags: needinfo?(ailea)

Verified - Fixed in the latest Nightly build 114.0a1 (2023-04-19) on Windows 10 and macOS 12. The autofill is working as expected after clearing the form.
Thanks.

Status: NEW → RESOLVED
Closed: 1 year ago
Flags: needinfo?(ailea)
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: