-
Notifications
You must be signed in to change notification settings - Fork 1.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
[Fabric] Implement IExpandCollapseProvider #13892
Conversation
@@ -181,6 +193,15 @@ HRESULT __stdcall CompositionDynamicAutomationProvider::GetPatternProvider(PATTE | |||
AddRef(); | |||
} | |||
|
|||
if (patternId == UIA_ExpandCollapsePatternId && | |||
(accessibilityRole == "combobox" || accessibilityRole == "splitbutton" || accessibilityRole == "treeitem" || | |||
(expandableControl(props) && |
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.
I know we do this pattern elsewhere, but do we really need to gate on accessibilityRole if expandable is set? Is there an actual limitation in UIA where a JS component author can't define say, a switch with expandable?
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.
UIA would not stop us. We would be able to specify a Switch control type that implements the ExpandCollapse provider, but that would have the wrong accessibility conventions. i.e. a control like that would not meet "correct" accessibility rules. The role checks here were mostly added as "guard rails" for JS developers who aren't as familiar with UIA accessibility expectations. They help prevent JS developers from building apps with wonky accessibility implementations.
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.
Is this a case where we are potentially blocking something, which while unusual, might be desired.
What if I have a switch which expands/collapses a bunch of UI based on its state. Maybe I want it to report both expand state and the rest of the switch state.
I always worry about these kinds of restrictive policies. What if I'm designing some completely new kind of control type, where expandable very much makes sense, but I dont want UIA reporting that I'm a combobox (or any of these other options). If I set accessibilityState.expanded - I'd expect that to report to the accessibility tools. It would be completely non-obvious that actually for that to work I need to set the role to one of several special values.
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.
Since we've followed this pattern for other providers so far I don't want to merge this PR with a different behavior pattern. I'm happy to rediscuss this concern, but let's do it in a separate issue and if we decide to remove the guard rails we can do so for all providers in one PR.
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.
Issue filed #13934
* Implement IExpandCollapseProvider * Change files * Adjust Example * Format + Update Snapshots
* Implement IExpandCollapseProvider * Change files * Adjust Example * Format + Update Snapshots
* Implement IExpandCollapseProvider * Change files * Adjust Example * Format + Update Snapshots
* [Fabric] Implement IExpandCollapseProvider (#13892) * Implement IExpandCollapseProvider * Change files * Adjust Example * Format + Update Snapshots * [Fabric] implement tooltip property (#13941) * [Fabric] implement view tooltip property * format * Change files * update * Fix lingering tooltip if component is unmounted while tooltip showing * snapshot --------- Co-authored-by: Jon Thysell <jthysell@microsoft.com> * Fix RootComponentView leak (#13959) * Fix RootComponentView leak * Change files * format --------- Co-authored-by: React-Native-Windows Bot <53619745+rnbot@users.noreply.github.com> * Add Support for AccessibilityState:Busy (#13952) * Support AccessibilityState: Busy * Change files * Add Testing * Update Snapshots * Update for Leak --------- Co-authored-by: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Co-authored-by: Jon Thysell <jthysell@microsoft.com> Co-authored-by: React-Native-Windows Bot <53619745+rnbot@users.noreply.github.com>
* [Fabric] Implement IExpandCollapseProvider (#13892) * Implement IExpandCollapseProvider * Change files * Adjust Example * Format + Update Snapshots * [Fabric] implement tooltip property (#13941) * [Fabric] implement view tooltip property * format * Change files * update * Fix lingering tooltip if component is unmounted while tooltip showing * snapshot --------- Co-authored-by: Jon Thysell <jthysell@microsoft.com> * Fix RootComponentView leak (#13959) * Fix RootComponentView leak * Change files * format --------- Co-authored-by: React-Native-Windows Bot <53619745+rnbot@users.noreply.github.com> * Add Support for AccessibilityState:Busy (#13952) * Support AccessibilityState: Busy * Change files * Add Testing * Update Snapshots * Update for Leak * Update change files to use patch instead of prerelease * fix * Update snapshot --------- Co-authored-by: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Co-authored-by: Jon Thysell <jthysell@microsoft.com> Co-authored-by: React-Native-Windows Bot <53619745+rnbot@users.noreply.github.com>
* Add Support for AccessibilityState:Busy (#13952) * Support AccessibilityState: Busy * Change files * Add Testing * Update Snapshots * Update for Leak * Fix RootComponentView leak (#13959) * Fix RootComponentView leak * Change files * format --------- Co-authored-by: React-Native-Windows Bot <53619745+rnbot@users.noreply.github.com> * [Fabric] implement tooltip property (#13941) * [Fabric] implement view tooltip property * format * Change files * update * Fix lingering tooltip if component is unmounted while tooltip showing * snapshot --------- Co-authored-by: Jon Thysell <jthysell@microsoft.com> * [Fabric] Implement IExpandCollapseProvider (#13892) * Implement IExpandCollapseProvider * Change files * Adjust Example * Format + Update Snapshots * Change files prerelease->patch * update snapshots --------- Co-authored-by: Chiara Mooney <34109996+chiaramooney@users.noreply.github.com> Co-authored-by: React-Native-Windows Bot <53619745+rnbot@users.noreply.github.com> Co-authored-by: Jon Thysell <jthysell@microsoft.com>
Description
Type of Change
Why
Implement ExpandCollapse provider so controls can display correct control state to UIA and custom controls can write expand collapse functionality.
Resolves #13352
Resolves #13067
Resolves #13063
Resolves #13059
Resolves #13055
Resolves #13051
Resolves #13047
Resolves #13043
Resolves #13039
Resolves #13035
#13316
#13327
What
Screenshots
Add any relevant screen captures here from before or after your changes.
Testing
Tested the following:
accessibilityState
: expanded=true, expanded=false, empty accessibilityState, accessibilityState not specifiedaria-expanded
: set to true, false, undefinedaccessibilityActions
: set/unset 'expand' and 'collapse' actionsChangelog
Should this change be included in the release notes: Yes
Implement UIA ExpandCollapse Pattern allowing custom controls to implement 'expand' and 'collapse' actions.
Microsoft Reviewers: Open in CodeFlow