[PM-14054] Fix scroll based re-positioning of the inline menu within iframes after setting is changed to on button click (#11763)

This commit is contained in:
Cesar Gonzalez 2024-10-28 16:43:06 -05:00 committed by GitHub
parent 9da80a6cba
commit 3fe84b041a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 2 deletions

View File

@ -1009,7 +1009,10 @@ export class OverlayBackground implements OverlayBackgroundInterface {
this.logService.error(error), this.logService.error(error),
); );
if ((await this.getInlineMenuVisibility()) === AutofillOverlayVisibility.OnButtonClick) { if (
(await this.getInlineMenuVisibility()) === AutofillOverlayVisibility.OnButtonClick &&
!this.isInlineMenuListVisible
) {
return; return;
} }
@ -2579,7 +2582,7 @@ export class OverlayBackground implements OverlayBackgroundInterface {
* @param sender * @param sender
*/ */
private resetFocusedFieldSubFrameOffsets(sender: chrome.runtime.MessageSender) { 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); 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) { private async triggerSubFrameFocusInRebuild(sender: chrome.runtime.MessageSender) {
this.cancelInlineMenuFadeInAndPositionUpdate(); this.cancelInlineMenuFadeInAndPositionUpdate();
this.resetFocusedFieldSubFrameOffsets(sender);
this.rebuildSubFrameOffsets$.next(sender); this.rebuildSubFrameOffsets$.next(sender);
this.repositionInlineMenu$.next(sender); this.repositionInlineMenu$.next(sender);
} }