1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-22 16:29:09 +01:00

[PM-5189] Fixing issue found in Safari with how the inline menu is re-positioned

This commit is contained in:
Cesar Gonzalez 2024-06-17 10:56:07 -05:00
parent ee8b179b6c
commit 22299ce4fb
No known key found for this signature in database
GPG Key ID: 3381A5457F8CCECF

View File

@ -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
);
}