diff --git a/src/usePopover.ts b/src/usePopover.ts index 5e33d15..9f24b9b 100644 --- a/src/usePopover.ts +++ b/src/usePopover.ts @@ -130,6 +130,10 @@ export const usePopover = ({ finalTop = nudgedTop; finalLeft = nudgedLeft; } + + if (window.scrollY > 0) { + finalTop = rect.top; + } popoverRef.current.style.transform = `translate(${finalLeft - scoutRect.left}px, ${ finalTop - scoutRect.top }px)`;