Add Accessibility Selected for iOS CollectionView#29014
Merged
Conversation
8141c5c to
9686f7e
Compare
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds accessibility support for CollectionView selection on Android and iOS by updating the accessibility state of selected items so that screen readers announce selection.
- Added new tests in both TestCases.Shared.Tests and TestCases.HostApp to verify accessibility updates.
- Introduced new extension methods on iOS to update and clear accessibility traits, and updated the platform-specific handlers accordingly.
- Updated Android view holder to reflect selection state.
Reviewed Changes
Copilot reviewed 26 out of 28 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| TestCases.Shared.Tests/Tests/Issues/Issue21375_2.cs | Added UI automation tests for double selection scenarios. |
| TestCases.Shared.Tests/Tests/Issues/Issue21375.cs | Provided tests for single and multiple selection modes. |
| TestCases.HostApp/Issues/Issue21375_2.xaml.cs | Updated host app page to support CollectionView selection modes. |
| TestCases.HostApp/Issues/Issue21375.xaml.cs | Updated host app page for CollectionView selection and screenshot verification. |
| Core/Platform/iOS/Extensions/AcessibilityExtensions.cs | Added extension methods to update and clear accessibility traits on iOS. |
| Core/Handlers/Items2/iOS/SelectableItemsViewController2.cs | Injected calls to update accessibility traits on item selection changes. |
| Core/Handlers/Items/iOS/SelectableItemsViewController.cs | Similar updates as in Items2, updating accessibility traits on selection/deselection. |
| Core/Handlers/Items/Android/SelectableViewHolder.cs | Updated the Android view holder to reflect selection state changes. |
Files not reviewed (2)
- src/Controls/tests/TestCases.HostApp/Issues/Issue21375.xaml: Language not supported
- src/Controls/tests/TestCases.HostApp/Issues/Issue21375_2.xaml: Language not supported
Comments suppressed due to low confidence (1)
src/Controls/src/Core/Platform/iOS/Extensions/AcessibilityExtensions.cs:5
- The class name 'AcessibilityExtensions' appears to be misspelled; consider renaming it to 'AccessibilityExtensions' for clarity and consistency.
internal static class AcessibilityExtensions
PureWeen
approved these changes
May 7, 2025
SuthiYuvaraj
pushed a commit
to SuthiYuvaraj/maui
that referenced
this pull request
May 9, 2025
* work for iOS and Android * sample code to remove later * working when changing selectionMode with iOS and android * UITests * Adds windows to UITest * add tests for CV2 * screenshots 1 * screenshots 2 * screenshots 3 * screenshots 4 * add windows delay and rename similarly named tests * screenshots 5 * screenshots 6 * screenshots 7 * typo in class name * removing android stuff
github-actions bot
pushed a commit
that referenced
this pull request
Jun 6, 2025
This reverts commit 8a8cef3.
rmarinho
pushed a commit
that referenced
this pull request
Jun 6, 2025
rmarinho
pushed a commit
that referenced
this pull request
Jun 6, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of Change
When an item is selected in a CollectionView, a screen reader user would expect that the selected item(s) would be announced as "selected". This PR adds the ability to update the accessibility state of the selected item(s) in the CollectionView for
both Android andiOS platforms. MacCatalyst and Windows already behave this way.Edit: Holding off on Android for now
Issues Fixed
Fixes #21375
and partially fixes (but does not close) #27460