Skip to content

[ScrollViewerPresenter] Fix rtl scroll (#16667) #17714

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

Merged
merged 5 commits into from
Feb 1, 2025

Conversation

ijklam
Copy link
Contributor

@ijklam ijklam commented Dec 8, 2024

What does the pull request do?

Make ScrollViewerPresenter horizontal scroll more natural when FlowDirection set to RightToLeft.

Fix #16667.

What is the current behavior?

When FlowDirection set to RightToLeft, swiping from right to left will move the left-hand-side content to the right.

default.mp4

What is the updated/expected behavior with this PR?

When FlowDirection set to RightToLeft, swiping from right to left should move the right-hand-side content to the left.

default.mp4

Checklist

Fixed issues

Fix #16667.

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0053757-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added the bug label Dec 10, 2024
@ijklam
Copy link
Contributor Author

ijklam commented Dec 17, 2024

@maxkatz6 Any updates?

Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

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

Thank you for your contribution!
A couple of minor comments and this will be good to merge.

@avaloniaui-bot
Copy link

You can test this PR using the following package version. 11.3.999-cibuild0054299-alpha. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]


else
{
delta = AdjustDeltaForFlowDirection(delta, FlowDirection);
Copy link
Member

Choose a reason for hiding this comment

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

This should be done unconditionally, not in an else block. Otherwise, shift + scroll wheel is still reversed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not sure about this. I think shift+scroll should remained the original behavior, as scrolling up means to show later content. Maybe ask some native Arabic speakers' opinion like @Mop1398

Copy link
Member

Choose a reason for hiding this comment

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

Afaict, at least on browsers, shift+wheel up scrolls left even with direction: rtl.
But I'm no expert here, let's wait for a native speaker's input.

Copy link
Member

Choose a reason for hiding this comment

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

Note: I've searched for, but couldn't find any other behavior than Shift+Left scrolling Up and Shift+Right scrolling Down, whatever the text direction.

I don't want to hold this PR, as the original issue is fixed. I'm going to merge it. We can revisit the Shift+Left/Right scrolling in another issue if needed.

Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@MrJul MrJul added this pull request to the merge queue Feb 1, 2025
Merged via the queue into AvaloniaUI:master with commit 19017f1 Feb 1, 2025
10 checks passed
@MrJul MrJul added the backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch label Feb 2, 2025
@maxkatz6 maxkatz6 added backported-11.2.x and removed backport-candidate-11.2.x Consider this PR for backporting to 11.2 branch labels Feb 15, 2025
maxkatz6 pushed a commit that referenced this pull request Feb 15, 2025
* Fix rtl scroll (#16667)

* fix shift + scroll

---------

Co-authored-by: ijklam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ScrollContentPresenter horizontal scroll inverts when FlowDirection is RTL in MacOS trackpad
4 participants