From 0dfdad07e294a4b28a7f57008fed7ce7e410ea32 Mon Sep 17 00:00:00 2001 From: Cesar Gonzalez Date: Wed, 22 May 2024 05:04:16 -0500 Subject: [PATCH] [PM-5189] Fixing an issue where the inline menu might not close when switching between frames --- apps/browser/src/autofill/background/overlay.background.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/browser/src/autofill/background/overlay.background.ts b/apps/browser/src/autofill/background/overlay.background.ts index abbb870df66..c88e25b5aa7 100644 --- a/apps/browser/src/autofill/background/overlay.background.ts +++ b/apps/browser/src/autofill/background/overlay.background.ts @@ -440,7 +440,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { return; } - if (this.isFieldCurrentlyFocused) { + if (sender.frameId === this.focusedFieldData?.frameId && this.isFieldCurrentlyFocused) { return; } @@ -984,6 +984,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { } this.storeOverlayPort(port); + port.onDisconnect.addListener(this.handlePortOnDisconnect); port.onMessage.addListener(this.handleOverlayElementPortMessage); port.postMessage({ command: `initAutofillInlineMenu${isInlineMenuListPort ? "List" : "Button"}`,