-
Notifications
You must be signed in to change notification settings - Fork 32
Description
I use useMeasure
on a simple div element. When I refresh the page, the scroll stays at the same position after the refresh as before, both on Safari, Chrome and Firefox.
My element's position values change because it doesn't calculate the window scroll values to add the Y overflow to the top/Y and the X overflow to the left/X.
I know this is the way getBoundingClientRect
works but it could be very useful to get the right position values.
I've made a small repro here and a video:
https://user-images.githubusercontent.com/14930937/145437063-1438c794-d2af-4a02-a21a-7e241c7f37d7.mov
The scroll option fix this problem but it re-render the component each time I scroll, which is not fully efficient.
Maybe it could be a good solution to pass an option for this specific behavior?