1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-08 12:40:26 +00:00

PM-26053 fix +New Login not spawning the popup

This commit is contained in:
Jeffrey Holland
2025-11-06 16:32:22 +01:00
parent f76d2f36e6
commit 7d11f901aa
3 changed files with 7 additions and 3 deletions

View File

@@ -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 },

View File

@@ -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);
}

View File

@@ -25,6 +25,7 @@ export const EVENTS = {
MOUSELEAVE: "mouseleave",
MOUSEUP: "mouseup",
MOUSEOUT: "mouseout",
MOUSEDOWN: "mousedown",
SUBMIT: "submit",
} as const;