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:
@@ -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 },
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ export const EVENTS = {
|
||||
MOUSELEAVE: "mouseleave",
|
||||
MOUSEUP: "mouseup",
|
||||
MOUSEOUT: "mouseout",
|
||||
MOUSEDOWN: "mousedown",
|
||||
SUBMIT: "submit",
|
||||
} as const;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user