Expose AutoSuggestBox AccessKey through editable TextBox - #11729
Open
Rashmi Thakur (rashmi-thakurr) wants to merge 3 commits into
Open
Expose AutoSuggestBox AccessKey through editable TextBox#11729Rashmi Thakur (rashmi-thakurr) wants to merge 3 commits into
Rashmi Thakur (rashmi-thakurr) wants to merge 3 commits into
Conversation
Derive the AutoSuggestBox AccessKey dynamically from its verified editable TextBox automation peer while preserving explicit child values and avoiding dependency-property mutation. Add UIA and precedence coverage. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 97ad465d-30ee-4a40-b0cd-54285d48a009
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Rashmi Thakur (rashmi-thakurr)
marked this pull request as draft
August 31, 2026 13:59
added 2 commits
August 31, 2026 20:07
Move the editable TextBox AccessKey behavior out of the shared automation peer. Preserve explicit child values, track AutoSuggestBox ownership, and clear only values supplied by AutoSuggestBox. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 21452886-d731-4386-bf87-f4461c8bd264
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 21452886-d731-4386-bf87-f4461c8bd264
Rashmi Thakur (rashmi-thakurr)
marked this pull request as ready for review
August 31, 2026 15:09
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Copilot started reviewing on behalf of
Akanksha Patel (akanpatel2206)
August 31, 2026 16:25
View session
There was a problem hiding this comment.
Pull request overview
This PR fixes an accessibility/automation gap in AutoSuggestBox by ensuring UI Automation clients can discover an AutoSuggestBox’s AccessKey from the focused editable TextBox element (the primary automation target for editing).
Changes:
- Adds
AutoSuggestBoxlogic to propagate a formattedAccessKeyto the internal editableTextBoxviaAutomationProperties.AccessKey, but only when theTextBoxhas noAccessKey(or automation access key) set on itself. - Tracks ownership of the propagated value so it can update/clear only what
AutoSuggestBoxsupplied, including correct behavior across template reapplication. - Adds/updates native external automation integration tests to cover propagation, precedence (child
AccessKeyandAutomationProperties.AccessKey), resumption after clears, and ensuringAutomationIdis not propagated.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| dxaml/xcp/dxaml/lib/AutoSuggestBox_Partial.h | Declares new helpers/state for propagating and tracking the propagated AccessKey on the editable TextBox. |
| dxaml/xcp/dxaml/lib/AutoSuggestBox_Partial.cpp | Implements propagation/ownership logic, wires a property-changed callback on the child TextBox.AccessKey, and updates propagation on relevant parent property changes and templating. |
| dxaml/test/native/external/controls/autosuggestbox/AutoSuggestBoxAutomationPeerIntegrationTests.h | Adds a new test method and extends helper setup to optionally apply an AccessKey. |
| dxaml/test/native/external/controls/autosuggestbox/AutoSuggestBoxAutomationPeerIntegrationTests.cpp | Extends automation-property verification and adds a precedence-focused test covering parent updates, child precedence (including explicit empty), and resumption. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Contributor
Author
|
/azp run |
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes
Fixes #7777
PR Type
Description
Current Behavior
AutoSuggestBox exposes editing through an internal TextBox. When an AccessKey is set on the AutoSuggestBox, the focused TextBox automation element does not report it, so Narrator and other UI Automation clients cannot discover the shortcut.
New Behavior
AutoSuggestBox now supplies its formatted AccessKey to its editable TextBox only when the child has no AccessKey value of its own. The implementation is contained entirely in AutoSuggestBox; it does not modify the shared TextBoxAutomationPeer.
AutoSuggestBox tracks whether it owns the supplied value. Parent updates propagate only while that ownership remains valid, and clearing or retemplating removes only the value AutoSuggestBox supplied. A child AccessKey set later, including an explicitly empty value, immediately takes precedence. Clearing that child value allows propagation to resume.
AutomationId is not propagated, and the UIA tree is unchanged.
Customer Impact
Narrator, Accessibility Insights, and other UI Automation clients can discover the AutoSuggestBox AccessKey from the focused editable TextBox. Custom template values, explicit child values, standalone TextBox behavior, AutomationIds, and UIA hierarchy remain unchanged.
Regression Potential
The behavioral change is isolated to AutoSuggestBox and its verified editable TextBox template part. It does not alter shared TextBox automation behavior or other controls.
How Has This Been Tested?
Screenshots (if appropriate)
Not applicable; this change has no visual impact.