everweij / react-laag

Hooks to build things like tooltips, dropdown menu's and popovers in React
https://www.react-laag.com
MIT License
907 stars 47 forks source link

Fix incorrect window bounds #78

Closed jhnns closed 2 years ago

jhnns commented 2 years ago

Hi @everweij 👋

thanks for this awesome library ❤️

While using it in my application, I noticed that the containerOffset doesn't take the scrollbar size into account when the scroll container is just the <html> element. Since the scrollbar size is subtracted for all other scroll containers I figured this is a bug in the implementation (correct me if I'm wrong 😁).

Here are two screenshots that illustrate the problem.

Without fix and containerOffset: 10:

Screenshot 2021-10-11 at 18 27 02

With fix and containerOffset: 10:

Screenshot 2021-10-11 at 18 24 23

everweij commented 2 years ago

Sorry for the late response, and thanks a lot for your work!