Magento – Magento Checkout Street Line Autofill Bug

customer-addressfrontend

I've noticed recently that a number of orders in our Magento store have street line 1 copied into street line 2.

I did some digging and it appears to be related to Chrome's autofill. If you look at the form fields, Magento uses billing[street][] and shipping[street][] as the field names for both street lines. So Chrome can't figure out which one is which and autofills address line 1 into both fields.

There's some info floating around that you can use the autocomplete attribute on the form input field to indicate which field it should link to, but this isn't supported and doesn't work. In fact, if you try to do that, it disables autocomplete on the entire form. I also tried changing the field name, but that breaks checkout. It seems I'd need to dig deep into the code and change the field name on the form and anywhere it is referenced, submitted to PayPal, saved in the DB, etc. This seems like a nightmare.

Has anyone dealt with this and/or have a suggestion?

Best Answer

You could also try the x-autocompletetype-attribute, although this is an experimental feature:

<input x-autocompletetype="address-line1" />
<input x-autocompletetype="address-line2" />
Related Topic