-
-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When Scrolled to bottom scrollOffset is not equal to scrollSize in Windows #175
Comments
@saqlain1020
You can access html element of scroller with passing your custom component to |
window.devicePixelRatio is 1.25 |
@inokawa How can i get html element ref, basically i am thinking of checking scrollHeight for determining if scrolled to bottom. |
Thank you! My recommended workaround for now is just add offset for the error like Lines 223 to 224 in 146811e
useEffect(() => {
const el = document.querySelector(".foo");
}, [])
<VList className="foo">
{items}
</VList> I'll try to investigate why they are not equal under some dpr. |
Also there is a warning in nextjs console that useLayoutEffect should not be used in server environment, i want to use VList on client side only, so take a look at it as well, might change useLayoutEffect to useEffect |
I implemented not to use useLayoutEffect in server like this. Maybe it isn't working for some reason with Next.js... 🤔 virtua/src/react/useIsomorphicLayoutEffect.ts Lines 4 to 5 in 146811e
|
The warn will be fixed in |
I found that scrollSize from handle has rounded value but scrollSize internally used in this lib is not. I fixed that in I close this issue because I have no idea how to reduce the error further and I think the fix made we can detect at bottom stably now like this: virtua/stories/basics/VList.stories.tsx Lines 488 to 494 in bd877ce
Of Course any improvements and information are welcome. |
Describe the bug
Cannot determine by looking at scrollOffset, scrollSize and viewportSize that the user has scrolled to bottom.
scrollOffset + viewportSize does not equal scrollSize, the sum is usually 2-15 units different.
To Reproduce
Scroll to bottom in a virtual list then console vlist refrence and check scrollOffset,scrollSize and viewportSize to see if by any combination you can identify if user has scrolled to bottom
Expected behavior
scrollOffset should be equal to scrollSize.
Platform:
Additional context
If we can get refrence to the html element which has the scroll bar in onScroll event listener that would be make things easier.
The text was updated successfully, but these errors were encountered: