1
0
mirror of https://github.com/bitwarden/browser.git synced 2025-02-12 00:41:29 +01:00

[PM-17969] Bugfix - Notification bar does not come up when creating an account demo.yubico.com/playground (#13253)

* add keyword to account creation field keywords

* include html class attribute value when gathering form attribute information

* misc cleanup/consistency

* update tests
This commit is contained in:
Jonathan Prusik 2025-02-04 15:18:14 -05:00 committed by GitHub
parent f9efbf0a6a
commit 0b17d9e74d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 14 additions and 5 deletions

View File

@ -424,6 +424,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
}
await this.setupSubmitListenerOnFormlessField(formFieldElement);
return;
}
/**
@ -439,15 +440,16 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
this.formElements.add(formElement);
formElement.addEventListener(EVENTS.SUBMIT, this.handleFormFieldSubmitEvent);
const closesSubmitButton = await this.findSubmitButton(formElement);
const closestSubmitButton = await this.findSubmitButton(formElement);
// If we cannot find a submit button within the form, check for a submit button outside the form.
if (!closesSubmitButton) {
if (!closestSubmitButton) {
await this.setupSubmitListenerOnFormlessField(formFieldElement);
return;
}
this.setupSubmitButtonEventListeners(closesSubmitButton);
this.setupSubmitButtonEventListeners(closestSubmitButton);
return;
}
}
@ -459,9 +461,11 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
*/
private async setupSubmitListenerOnFormlessField(formFieldElement: FillableFormFieldElement) {
if (formFieldElement && !this.fieldsWithSubmitElements.has(formFieldElement)) {
const closesSubmitButton = await this.findClosestFormlessSubmitButton(formFieldElement);
this.setupSubmitButtonEventListeners(closesSubmitButton);
const closestSubmitButton = await this.findClosestFormlessSubmitButton(formFieldElement);
this.setupSubmitButtonEventListeners(closestSubmitButton);
}
return;
}
/**

View File

@ -317,6 +317,7 @@ describe("CollectAutofillContentService", () => {
__form__0: {
opid: "__form__0",
htmlAction: formAction,
htmlClass: null,
htmlName: formName,
htmlID: formId,
htmlMethod: formMethod,
@ -544,6 +545,7 @@ describe("CollectAutofillContentService", () => {
__form__0: {
opid: "__form__0",
htmlAction: formAction1,
htmlClass: null,
htmlName: formName1,
htmlID: formId1,
htmlMethod: formMethod1,
@ -551,6 +553,7 @@ describe("CollectAutofillContentService", () => {
__form__1: {
opid: "__form__1",
htmlAction: formAction2,
htmlClass: null,
htmlName: formName2,
htmlID: formId2,
htmlMethod: formMethod2,

View File

@ -228,6 +228,7 @@ export class CollectAutofillContentService implements CollectAutofillContentServ
opid: formElement.opid,
htmlAction: this.getFormActionAttribute(formElement),
htmlName: this.getPropertyOrAttribute(formElement, "name"),
htmlClass: this.getPropertyOrAttribute(formElement, "class"),
htmlID: this.getPropertyOrAttribute(formElement, "id"),
htmlMethod: this.getPropertyOrAttribute(formElement, "method"),
});

View File

@ -56,6 +56,7 @@ export class InlineMenuFieldQualificationService
"neuer benutzer",
"neues passwort",
"neue e-mail",
"pwdcheck",
];
private updatePasswordFieldKeywords = [
"update password",