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

Fix the direction of scrolling when pressing on the scrollbar track with reverseLayout=true #1221

Merged

Conversation

m-sasha
Copy link

@m-sasha m-sasha commented Mar 25, 2024

The direction of scrolling when pressing on the track doesn't currently take the reverseLayout parameter into consideration. This PR fixes it.

Testing

Test: Added a unit test.

Issues Fixed

Fixes: JetBrains/compose-multiplatform#4539

…outside the thumb) with `reverseLayout=true`.
@m-sasha m-sasha requested a review from MatkovIvan March 25, 2024 12:11
Comment on lines +912 to +913
offset < pixelRange.first -> if (reverseLayout) 1 else -1
offset > pixelRange.last -> if (reverseLayout) -1 else 1
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This the crux of the fix.

@m-sasha m-sasha merged commit 66c4e0d into jb-main Mar 25, 2024
6 checks passed
@m-sasha m-sasha deleted the m-sasha/fix-scrollbar-track-press-with-reverseLayout branch March 25, 2024 14:25
@avently
Copy link

avently commented Mar 25, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants