mirror of
https://github.com/bitwarden/browser
synced 2025-12-15 15:53:27 +00:00
[PM-5189] Fixing issue with how we remove the inline menu when a field is populated
This commit is contained in:
@@ -460,11 +460,13 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
|
|||||||
this.clearUserInteractionEventTimeout();
|
this.clearUserInteractionEventTimeout();
|
||||||
const initiallyFocusedField = this.mostRecentlyFocusedField;
|
const initiallyFocusedField = this.mostRecentlyFocusedField;
|
||||||
await this.updateMostRecentlyFocusedField(formFieldElement);
|
await this.updateMostRecentlyFocusedField(formFieldElement);
|
||||||
const formElementHasValue = Boolean((formFieldElement as HTMLInputElement).value);
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
this.inlineMenuVisibility === AutofillOverlayVisibility.OnButtonClick ||
|
this.inlineMenuVisibility === AutofillOverlayVisibility.OnButtonClick ||
|
||||||
(formElementHasValue && initiallyFocusedField !== this.mostRecentlyFocusedField)
|
(initiallyFocusedField !== this.mostRecentlyFocusedField &&
|
||||||
|
(await this.hideAutofillInlineMenuListOnFilledField(
|
||||||
|
formFieldElement as FillableFormFieldElement,
|
||||||
|
)))
|
||||||
) {
|
) {
|
||||||
await this.sendExtensionMessage("closeAutofillInlineMenu", {
|
await this.sendExtensionMessage("closeAutofillInlineMenu", {
|
||||||
overlayElement: AutofillOverlayElement.List,
|
overlayElement: AutofillOverlayElement.List,
|
||||||
@@ -1035,6 +1037,7 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ
|
|||||||
formFieldElement.removeEventListener(EVENTS.KEYUP, this.handleFormFieldKeyupEvent);
|
formFieldElement.removeEventListener(EVENTS.KEYUP, this.handleFormFieldKeyupEvent);
|
||||||
this.formFieldElements.delete(formFieldElement);
|
this.formFieldElements.delete(formFieldElement);
|
||||||
});
|
});
|
||||||
|
globalThis.removeEventListener(EVENTS.MESSAGE, this.handleWindowMessageEvent);
|
||||||
globalThis.document.removeEventListener(
|
globalThis.document.removeEventListener(
|
||||||
EVENTS.VISIBILITYCHANGE,
|
EVENTS.VISIBILITYCHANGE,
|
||||||
this.handleVisibilityChangeEvent,
|
this.handleVisibilityChangeEvent,
|
||||||
|
|||||||
Reference in New Issue
Block a user