You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
useScroll behaves incorrectly when the scrolling element is a flexbox container with either direction: column-reverse or direction: row-reverse.
I encountered this issue while making a chat app which needed to use useInfiniteScroll, I noticed that whenever I set the scrolling element to column-reverse the callback would stop triggering, after digging for the source code I found that the issue came from the underlying useScroll function which does not handle those cases, turns out the element.scrollTop value is negative on reversed flex elements.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a VueUse issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to https://github.com/vuejs/core instead.
Check that this is a concrete bug. For Q&A open a GitHub Discussion.
I would also like to point out another issue introduced in a previous PR #1996 where the "scrolling right" value was incorrectly set to check against the scrollY value which made it either always true or always false.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug
useScroll behaves incorrectly when the scrolling element is a flexbox container with either
direction: column-reverse
ordirection: row-reverse
.I encountered this issue while making a chat app which needed to use useInfiniteScroll, I noticed that whenever I set the scrolling element to column-reverse the callback would stop triggering, after digging for the source code I found that the issue came from the underlying useScroll function which does not handle those cases, turns out the element.scrollTop value is negative on reversed flex elements.
I will be submitting a PR to fix the issue.
Reproduction
https://stackblitz.com/edit/vitejs-vite-mxmg7f?file=src/Repro.vue
System Info
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: