From 22299ce4fbfbd2f121d19537f2a1aeefabea4edc Mon Sep 17 00:00:00 2001 From: Cesar Gonzalez Date: Mon, 17 Jun 2024 10:56:07 -0500 Subject: [PATCH] [PM-5189] Fixing issue found in Safari with how the inline menu is re-positioned --- .../autofill/services/autofill-overlay-content.service.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/browser/src/autofill/services/autofill-overlay-content.service.ts b/apps/browser/src/autofill/services/autofill-overlay-content.service.ts index aec4d46b578..4f6ee8b8134 100644 --- a/apps/browser/src/autofill/services/autofill-overlay-content.service.ts +++ b/apps/browser/src/autofill/services/autofill-overlay-content.service.ts @@ -1133,10 +1133,14 @@ export class AutofillOverlayContentService implements AutofillOverlayContentServ */ private isFocusedFieldWithinViewportBounds() { const focusedFieldRectsTop = this.focusedFieldData?.focusedFieldRects?.top; + const focusedFieldRectsBottom = + focusedFieldRectsTop + this.focusedFieldData?.focusedFieldRects?.height; + const viewportHeight = globalThis.innerHeight + globalThis.scrollY; return ( focusedFieldRectsTop && focusedFieldRectsTop > 0 && - focusedFieldRectsTop < globalThis.innerHeight + globalThis.scrollY + focusedFieldRectsTop < viewportHeight && + focusedFieldRectsBottom < viewportHeight ); }