-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add Accessibility Selected for iOS CollectionView #29014
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
Conversation
8141c5c
to
9686f7e
Compare
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.
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
* 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
This reverts commit 8a8cef3.
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