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 scrollbar attaching to wrong scrollviewer, like scrollviewer … #12732

Merged
merged 3 commits into from
Aug 31, 2023

Conversation

liwuqingxin
Copy link
Contributor

@liwuqingxin liwuqingxin commented Aug 31, 2023

…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

@liwuqingxin
Copy link
Contributor Author

@dotnet-policy-service agree

@avaloniaui-team
Copy link
Contributor

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

Copy link
Member

@maxkatz6 maxkatz6 left a 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.

@liwuqingxin
Copy link
Contributor Author

@maxkatz6 I don't know why the AvaloniaUI.IntegrationTests(Mac) failed with the error like:

OpenQA.Selenium.WebDriverException : An unknown server-side error occurred while processing the command. Original error: 'POST /element' cannot be proxied to Mac2 Driver server because its process is not running (probably crashed). Check the Appium log for more details

Could you please tell me what should I do? 😅

@timunie
Copy link
Contributor

timunie commented Aug 31, 2023

@liwuqingxin sometimes the tests are running too long and break, esp. if there are several builds running. So I try to re-run them.

@avaloniaui-team
Copy link
Contributor

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

@maxkatz6 maxkatz6 added this pull request to the merge queue Aug 31, 2023
Merged via the queue into AvaloniaUI:master with commit fdf27e1 Aug 31, 2023
6 checks passed
@grokys grokys added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Oct 2, 2023
grokys pushed a commit that referenced this pull request Oct 2, 2023
Fix the scrollbar attaching to wrong scrollviewer, like scrollviewer …
@grokys grokys added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Oct 14, 2023
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.

DataGrid inside a ScrollViewer can not scroll normally.
5 participants