From 3fe84b041a17c8c9fe360a6cd73e700c26e1c32f Mon Sep 17 00:00:00 2001 From: Cesar Gonzalez Date: Mon, 28 Oct 2024 16:43:06 -0500 Subject: [PATCH] [PM-14054] Fix scroll based re-positioning of the inline menu within iframes after setting is changed to on button click (#11763) --- .../browser/src/autofill/background/overlay.background.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/browser/src/autofill/background/overlay.background.ts b/apps/browser/src/autofill/background/overlay.background.ts index 6fb4589baa..c1dc359e94 100644 --- a/apps/browser/src/autofill/background/overlay.background.ts +++ b/apps/browser/src/autofill/background/overlay.background.ts @@ -1009,7 +1009,10 @@ export class OverlayBackground implements OverlayBackgroundInterface { this.logService.error(error), ); - if ((await this.getInlineMenuVisibility()) === AutofillOverlayVisibility.OnButtonClick) { + if ( + (await this.getInlineMenuVisibility()) === AutofillOverlayVisibility.OnButtonClick && + !this.isInlineMenuListVisible + ) { return; } @@ -2579,7 +2582,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { * @param sender */ private resetFocusedFieldSubFrameOffsets(sender: chrome.runtime.MessageSender) { - if (this.focusedFieldData.frameId > 0 && this.subFrameOffsetsForTab[sender.tab.id]) { + if (this.focusedFieldData?.frameId > 0 && this.subFrameOffsetsForTab[sender.tab.id]) { this.subFrameOffsetsForTab[sender.tab.id].set(this.focusedFieldData.frameId, null); } } @@ -2592,6 +2595,7 @@ export class OverlayBackground implements OverlayBackgroundInterface { */ private async triggerSubFrameFocusInRebuild(sender: chrome.runtime.MessageSender) { this.cancelInlineMenuFadeInAndPositionUpdate(); + this.resetFocusedFieldSubFrameOffsets(sender); this.rebuildSubFrameOffsets$.next(sender); this.repositionInlineMenu$.next(sender); }