diff --git a/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.spec.ts b/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.spec.ts index b4e480797da..4de17f1188a 100644 --- a/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.spec.ts +++ b/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.spec.ts @@ -131,7 +131,7 @@ describe("AutofillInlineMenuList", () => { const addVaultItemButton = autofillInlineMenuList["inlineMenuListContainer"].querySelector("#new-item-button"); - addVaultItemButton.dispatchEvent(new Event("click")); + addVaultItemButton.dispatchEvent(new Event("mousedown")); expect(globalThis.parent.postMessage).toHaveBeenCalledWith( { command: "addNewVaultItem", portKey, addNewCipherType: CipherType.Login }, @@ -578,7 +578,7 @@ describe("AutofillInlineMenuList", () => { }); it("allows for the creation of a new login cipher", () => { - newVaultItemButtonSpy.dispatchEvent(new Event("click")); + newVaultItemButtonSpy.dispatchEvent(new Event("mousedown")); expect(globalThis.parent.postMessage).toHaveBeenCalledWith( { command: "addNewVaultItem", portKey, addNewCipherType: CipherType.Login }, diff --git a/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts b/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts index c680fe4745c..32fe3eeca8a 100644 --- a/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts +++ b/apps/browser/src/autofill/overlay/inline-menu/pages/list/autofill-inline-menu-list.ts @@ -551,7 +551,10 @@ export class AutofillInlineMenuList extends AutofillInlineMenuPageElement { this.newItemButtonElement.textContent = this.getNewItemButtonText(showLogin); this.newItemButtonElement.setAttribute("aria-label", this.getNewItemAriaLabel(showLogin)); this.newItemButtonElement.prepend(buildSvgDomElement(plusIcon)); - this.newItemButtonElement.addEventListener(EVENTS.CLICK, this.handleNewLoginVaultItemAction); + this.newItemButtonElement.addEventListener( + EVENTS.MOUSEDOWN, + this.handleNewLoginVaultItemAction, + ); return this.buildButtonContainer(this.newItemButtonElement); } diff --git a/libs/common/src/autofill/constants/index.ts b/libs/common/src/autofill/constants/index.ts index dc79e27b6aa..b248f9e7265 100644 --- a/libs/common/src/autofill/constants/index.ts +++ b/libs/common/src/autofill/constants/index.ts @@ -25,6 +25,7 @@ export const EVENTS = { MOUSELEAVE: "mouseleave", MOUSEUP: "mouseup", MOUSEOUT: "mouseout", + MOUSEDOWN: "mousedown", SUBMIT: "submit", } as const;