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

Forward pointer wheel event from scrollbar to scrollviewer #16398

Merged
merged 4 commits into from
Aug 2, 2024

Conversation

emmauss
Copy link
Contributor

@emmauss emmauss commented Jul 22, 2024

What does the pull request do?

Raises PointerWheelEvent on the scrollviewer's presenter by ScrollBar when it receives a PointerWheelChanged event.

What is the current behavior?

What is the updated/expected behavior with this PR?

How was the solution implemented (if it's not obvious)?

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #16372

@avaloniaui-bot
Copy link

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

@maxkatz6 maxkatz6 added backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch bug and removed bug labels Jul 22, 2024
@avaloniaui-bot
Copy link

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

// We need to handle pointer wheel event to allow scrolling with the pointer wheel. So we raise the event on the scrollviewer's presenter
if(!e.Handled && _owner?.Presenter is { } presenter)
{
presenter.RaiseEvent(e);
Copy link
Member

Choose a reason for hiding this comment

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

By re-raising the same RoutedEventArgs, this will change the observable RoutedEventArgs.Source and Route, so parent listeners will have wrong information to act on (e.g. Tunnel mode in a middle of a Bubble).

I think a copy of the event should be raised instead to avoid this.

The original event probably needs to be marked as handled if the copy is handled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update done.

@avaloniaui-bot
Copy link

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

@avaloniaui-bot
Copy link

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

@maxkatz6 maxkatz6 added this pull request to the merge queue Aug 1, 2024
Merged via the queue into master with commit 4c2d9fc Aug 2, 2024
11 checks passed
@maxkatz6 maxkatz6 deleted the scrollbar_wheel branch August 2, 2024 03:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-candidate-11.1.x Consider this PR for backporting to 11.1 branch bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mouse-wheel scrolling does not work when cursor is on scroll bar
4 participants