diff --git a/apps/browser/src/autofill/services/autofill.service.ts b/apps/browser/src/autofill/services/autofill.service.ts index e79f6f69a3..24054794b6 100644 --- a/apps/browser/src/autofill/services/autofill.service.ts +++ b/apps/browser/src/autofill/services/autofill.service.ts @@ -1597,16 +1597,6 @@ export default class AutofillService implements AutofillServiceInterface { ) { fillFields.email = f; break; - } else if ( - !fillFields.address && - AutofillService.isFieldMatch( - f[attr], - IdentityAutoFillConstants.AddressFieldNames, - IdentityAutoFillConstants.AddressFieldNameValues, - ) - ) { - fillFields.address = f; - break; } else if ( !fillFields.address1 && AutofillService.isFieldMatch(f[attr], IdentityAutoFillConstants.Address1FieldNames) @@ -1625,6 +1615,16 @@ export default class AutofillService implements AutofillServiceInterface { ) { fillFields.address3 = f; break; + } else if ( + !fillFields.address && + AutofillService.isFieldMatch( + f[attr], + IdentityAutoFillConstants.AddressFieldNames, + IdentityAutoFillConstants.AddressFieldNameValues, + ) + ) { + fillFields.address = f; + break; } else if ( !fillFields.postalCode && AutofillService.isFieldMatch(f[attr], IdentityAutoFillConstants.PostalCodeFieldNames) @@ -1818,11 +1818,6 @@ export default class AutofillService implements AutofillServiceInterface { continue; } - if (this.shouldMakeIdentityAddressFillScript(filledFields, keywordsList)) { - this.makeIdentityAddressFillScript(fillScript, filledFields, field, identity); - continue; - } - if (this.shouldMakeIdentityAddress1FillScript(filledFields, keywordsCombined)) { this.makeScriptActionWithValue(fillScript, identity.address1, field, filledFields); continue; @@ -1838,6 +1833,11 @@ export default class AutofillService implements AutofillServiceInterface { continue; } + if (this.shouldMakeIdentityAddressFillScript(filledFields, keywordsList)) { + this.makeIdentityAddressFillScript(fillScript, filledFields, field, identity); + continue; + } + if (this.shouldMakeIdentityPostalCodeFillScript(filledFields, keywordsCombined)) { this.makeScriptActionWithValue(fillScript, identity.postalCode, field, filledFields); continue;