1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-15 07:43:35 +00:00

[PM-5189] Fixing issue with how we remove the inline menu when a field is populated

This commit is contained in:
Cesar Gonzalez
2024-06-05 02:33:33 -05:00
parent 27066c4a08
commit ce593e024d

View File

@@ -460,11 +460,13 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
this.clearUserInteractionEventTimeout();
const initiallyFocusedField = this.mostRecentlyFocusedField;
await this.updateMostRecentlyFocusedField(formFieldElement);
const formElementHasValue = Boolean((formFieldElement as HTMLInputElement).value);
if (
this.inlineMenuVisibility === AutofillOverlayVisibility.OnButtonClick ||
(formElementHasValue && initiallyFocusedField !== this.mostRecentlyFocusedField)
(initiallyFocusedField !== this.mostRecentlyFocusedField &&
(await this.hideAutofillInlineMenuListOnFilledField(
formFieldElement as FillableFormFieldElement,
)))
) {
await this.sendExtensionMessage("closeAutofillInlineMenu", {
overlayElement: AutofillOverlayElement.List,
@@ -1035,6 +1037,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
formFieldElement.removeEventListener(EVENTS.KEYUP, this.handleFormFieldKeyupEvent);
this.formFieldElements.delete(formFieldElement);
});
globalThis.removeEventListener(EVENTS.MESSAGE, this.handleWindowMessageEvent);
globalThis.document.removeEventListener(
EVENTS.VISIBILITYCHANGE,
this.handleVisibilityChangeEvent,