Fix some issues on SelectingItemsControls when items or control changes visibility - #20798
Conversation
|
You can test this PR using the following package version. |
when nothing was selected beforehand and AlwaysSelected is true
The TabItem now handles the correct selection of only visible items
429ebbb to
b28138e
Compare
âĶElementAfterHide
Otherwise API-diff will fail.
|
You can test this PR using the following package version. |
robloo
left a comment
There was a problem hiding this comment.
I left some comments on the code changes but overall looks really good. I will have to find the time to test this later though. I've only looked at the code.
|
You can test this PR using the following package version. |
âĶElementAfterHide
- adding more tests to avoid regressions
c842a45 to
31fd7ce
Compare
âĶ test Agent-Logs-Url: https://github.com/timunie/Avalonia/sessions/fe2f1190-6d20-4982-8a03-1ae9b52ee701 Co-authored-by: timunie <47110241+timunie@users.noreply.github.com>
Agent-Logs-Url: https://github.com/timunie/Avalonia/sessions/8895cb60-ef41-473c-972b-bad2483a5a77 Co-authored-by: timunie <47110241+timunie@users.noreply.github.com>
|
You can test this PR using the following package version. |
|
@Copilot, Please read the following Contributor License Agreement (CLA). If you agree with the CLA, please reply with the following: Contributor License AgreementContribution License AgreementThis Contribution License Agreement ( âAgreementâ ) is agreed to by the party signing below ( âYouâ ), 1. Definitions. âCodeâ means the computer software code, whether in human-readable or machine-executable form, âProjectâ means any of the projects owned or managed by AvaloniaUI OÃ and offered under a license âSubmitâ is the act of uploading, submitting, transmitting, or distributing code or other content to any âSubmissionâ means the Code and any other copyrightable material Submitted by You, including any 2. Your Submission. You must agree to the terms of this Agreement before making a Submission to any 3. Originality of Work. You represent that each of Your Submissions is entirely Your 4. Your Employer. References to âemployerâ in this Agreement include Your employer or anyone else 5. Licenses. a. Copyright License. You grant AvaloniaUI OÃ, and those who receive the Submission directly b. Patent License. You grant AvaloniaUI OÃ, and those who receive the Submission directly or c. Other Rights Reserved. Each party reserves all rights not expressly granted in this Agreement. 6. Representations and Warranties. You represent that You are legally entitled to grant the above 7. Notice to AvaloniaUI OÃ. You agree to notify AvaloniaUI OÃ in writing of any facts or 8. Information about Submissions. You agree that contributions to Projects and information about 9. Governing Law/Jurisdiction. This Agreement is governed by the laws of the Republic of Estonia, and 10. Entire Agreement/Assignment. This Agreement is the entire agreement between the parties, and AvaloniaUI OÃ dedicates this Contribution License Agreement to the public domain according to the Creative Commons CC0 1. 2 out of 3 committers have signed the CLA. |
|
You can test this PR using the following package version. |
|
I've added several new failing tests for |
|
You can test this PR using the following package version. |
âĶes visibility (#20798) * Add failing test for #14718 * Fix for AutoScrollToSelectedItemIfNecessary * fix failing CI build and move test to the right location * add failing test for TabItem selection of invisble tab * introduce a helper method to figure out which item to select when nothing was selected beforehand and AlwaysSelected is true * ensure selection works for invisible tabcontrol * simplify conditions * propose: Remove redundant logic from ColorView The TabItem now handles the correct selection of only visible items * fix test: Need to set SelectedIndex after adding items * re-add unused method and make it obsolete Otherwise API-diff will fail. * Address review * Update tests/Avalonia.Controls.UnitTests/TabControlTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update tests/Avalonia.Controls.UnitTests/TabControlTests.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Adress copilot review * fix duplicate braces * address review * fix for failing tests on CarouselPage and TabbedPage * address feedback - adding more tests to avoid regressions * Fix failing test: add UnitTestApplication.Start() to dedicated thread test Agent-Logs-Url: https://github.com/timunie/Avalonia/sessions/fe2f1190-6d20-4982-8a03-1ae9b52ee701 Co-authored-by: timunie <47110241+timunie@users.noreply.github.com> * Refactor SelectingItemsControl auto-scroll duplicate logic Agent-Logs-Url: https://github.com/timunie/Avalonia/sessions/8895cb60-ef41-473c-972b-bad2483a5a77 Co-authored-by: timunie <47110241+timunie@users.noreply.github.com> * Add new failing tests for AlwaysSelected mode * Fix AlwaysSelected scenarios --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Julien Lebosquain <julien@lebosquain.net> Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
What does the pull request do?
What is the current behavior?
SelectingItemsControls with AlwaysSelected set can select invisible items by accident
What is the updated/expected behavior with this PR?
How was the solution implemented (if it's not obvious)?
Checklist
Breaking changes
ColorView API was changed by removing not needed protected void
Obsoletions / Deprecations
Fixed issues
Fixes #14718
Fixes #13736 (@robloo this should be the last issue to solve, so I'll close the rollup with this PR)
Fixes #19663