Skip to content
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

[useScroll] flex column-reverse and row-reverse #2576

Closed
7 tasks done
OneLoneFox opened this issue Dec 24, 2022 · 2 comments · Fixed by #2577
Closed
7 tasks done

[useScroll] flex column-reverse and row-reverse #2576

OneLoneFox opened this issue Dec 24, 2022 · 2 comments · Fixed by #2577

Comments

@OneLoneFox
Copy link
Contributor

OneLoneFox commented Dec 24, 2022

Describe the bug

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.

I will be submitting a PR to fix the issue.

Reproduction

https://stackblitz.com/edit/vitejs-vite-mxmg7f?file=src/Repro.vue

System Info

System:
    OS: Windows 10 10.0.19045
    CPU: (12) x64 AMD Ryzen 5 5600X 6-Core Processor
    Memory: 20.19 GB / 31.93 GB
  Binaries:
    Node: 16.14.2 - ~\AppData\Local\nvs\default\node.EXE
    Yarn: 1.22.18 - ~\AppData\Local\nvs\default\yarn.CMD
    npm: 8.5.0 - ~\AppData\Local\nvs\default\npm.CMD
  Browsers:
    Edge: Spartan (44.19041.1266.0), Chromium (108.0.1462.54)
    Internet Explorer: 11.0.19041.1566
  npmPackages:
    @vueuse/core: workspace:* => 9.9.0
    @vueuse/integrations: workspace:* => 9.9.0
    @vueuse/math: workspace:* => 9.9.0
    @vueuse/rxjs: workspace:* => 9.9.0
    @vueuse/shared: workspace:* => 9.9.0
    vue: ^3.2.41 => 3.2.41

Used Package Manager

pnpm

Validations

@OneLoneFox
Copy link
Contributor Author

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.

@stale
Copy link

stale bot commented Feb 22, 2023

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.

@stale stale bot added the stale label Feb 22, 2023
@stale stale bot closed this as completed Mar 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant