diff options
Diffstat (limited to 'toolkit/components/formautofill/default')
-rw-r--r-- | toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs b/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs index f166716de5..05dcf5bace 100644 --- a/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs +++ b/toolkit/components/formautofill/default/FormAutofillPrompter.sys.mjs @@ -789,16 +789,15 @@ export class AddressEditDoorhanger extends AutofillDoorhanger { input.setAttribute("id", inputId); - const value = this.newRecord[fieldName] ?? ""; if (popup) { - const menuitem = Array.from(popup.childNodes).find( - item => - item.label.toLowerCase() === value?.toLowerCase() || - item.value.toLowerCase() === value?.toLowerCase() - ); - input.selectedItem = menuitem; + input.selectedItem = + FormAutofillUtils.findAddressSelectOptionWithMenuPopup( + popup, + this.newRecord, + fieldName + ); } else { - input.value = value; + input.value = this.newRecord[fieldName] ?? ""; } div.appendChild(input); |