-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 scrollbar attaching to wrong scrollviewer, like scrollviewer … #12732
Fix the scrollbar attaching to wrong scrollviewer, like scrollviewer … #12732
Conversation
@dotnet-policy-service agree |
You can test this PR using the following package version. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't imagine any scenario, when ScrollViewer is not a TemplatedParent for ScrollBar.
So, LGTM.
@maxkatz6 I don't know why the AvaloniaUI.IntegrationTests(Mac) failed with the error like:
Could you please tell me what should I do? 😅 |
@liwuqingxin sometimes the tests are running too long and break, esp. if there are several builds running. So I try to re-run them. |
You can test this PR using the following package version. |
Fix the scrollbar attaching to wrong scrollviewer, like scrollviewer …
…outer a datagrid.
What does the pull request do?
Fix the bug that the scrollbar could attach to a wrong scrollviewer, like a scrollviewer outer a datagrid. #12482
What is the current behavior?
The scrollbar in control template of datagrid will find a nearest ancestor scrollviewer and attach to it. And there is no scrollviewer in control template of datagrid, the scrollbar in it's template will attach to the scrollviewer outer the datagrid, if it exsits.
Then, if we scroll the datagrid, the outer scrollviewer will be scrolled too.
What is the updated/expected behavior with this PR?
The scrollbar will not find the ancestor scrollviewer to attach to now. Instead it will try to attach to it's templatedparent if it is a scrollviewer.
I don't find any case that the scrollbar should bind to a scrollviewer that is not the scrollbar's tempatedparent. So if the case exists, stop this PR please.
How was the solution implemented (if it's not obvious)?
Checklist
Breaking changes
None.
Obsoletions / Deprecations
Fixed issues
Fixes #12482