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 aec4d46b57..4f6ee8b813 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 ); }