Expose TextBox/NumberBox/AutoSuggestBox clear button to Voice Access - #11639
Closed
Harini Malothu (HariniMalothu17) wants to merge 1 commit into
Closed
Conversation
The inline clear ("Delete") button shown by TextBox, NumberBox, and
AutoSuggestBox could not be targeted by Voice Access "Show numbers". The
template set AutomationProperties.AccessibilityView="Raw" on that button,
which removes it from the UIA Content view, and Voice Access only tags
elements in the Content view.
Remove the explicit AccessibilityView="Raw" from the DeleteButton in every
affected template so it reverts to the default Content view. The button
remains Visibility="Collapsed" (shown only in the ButtonVisible visual
state) and keeps IsTabStop="False", so it is exposed to Voice Access only
while it is actually visible and keyboard tab order is unchanged.
Add interaction tests verifying the visible clear/Delete button is exposed
(and invocable) for NumberBox inline mode and for TextBox, distinct from the
Increase/Decrease spin buttons.
Fixes microsoft#7996
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 2620f9d2-ff0f-45b0-aa36-3626abe3e83a
Harini Malothu (HariniMalothu17)
requested a review
from a team
as a code owner
August 25, 2026 09:34
Author
|
/azp run |
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. |
Contributor
|
/azp run |
|
Azure Pipelines: 1 pipeline(s) were filtered out due to trigger conditions. |
Author
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.
Summary
Fixes the Voice Access issue where the TextBox / NumberBox / AutoSuggestBox inline clear (
x) button could not be targeted by a number tag.When the inline clear button is shown (for example a
NumberBoxwithSpinButtonPlacementMode="Inline"), the button clears the entered text. It is a real namedButtonthat already receives a localized UIA name ("Delete"). However, the template explicitly setAutomationProperties.AccessibilityView="Raw"on thatDeleteButton, which excludes the element from the UIA Content view. Voice Access "Show numbers" only tags elements in the Content view, so the clear button never received a number tag and could not be targeted hands-free.Repro (from #7996)
x) button.What changed
Removed the explicit
AutomationProperties.AccessibilityView="Raw"from theDeleteButtonin every affected template, reverting it to its defaultContentaccessibility view. Because the button remainsVisibility="Collapsed"(only shown in theButtonVisiblevisual state) and keepsIsTabStop="False", it is exposed to Voice Access only while it is actually visible, and keyboard tab order is unchanged.controls/dev/CommonStyles/TextBox_themeresources.xaml— removedAccessibilityView="Raw"from theDeleteButtonin the default TextBox template.controls/dev/CommonStyles/TextBox_themeresources_perf2026.xaml— same change in the perf2026 TextBox template copy.controls/dev/NumberBox/NumberBox.xaml— removedAccessibilityView="Raw"from theDeleteButtonin the inner NumberBox TextBox style.controls/dev/NumberBox/NumberBox_perf2026.xaml— same change in the perf2026 NumberBox template copy.controls/dev/AutoSuggestBox/AutoSuggestBox_themeresources.xaml— removedAccessibilityView="Raw"from theDeleteButton.controls/dev/AutoSuggestBox/AutoSuggestBox_themeresources_perf2026.xaml— same change in the perf2026 AutoSuggestBox template copy.Tests
controls/dev/NumberBox/InteractionTests/NumberBoxTests.cs— addedVerifyClearButtonIsAccessible: switches NumberBox to inline mode, enters a value so the clear button is visible, and verifies the "Delete" button is exposed to UIA (found in the inner TextBox subtree), distinct from the Increase/Decrease spin buttons, then invokes it and checks the text is cleared.controls/dev/CommonStyles/InteractionTests/CommonStylesTests.cs— addedTextBoxClearButtonIsAccessibleTest: focuses a TextBox so the clear button is visible and verifies the "Delete" button is exposed to UIA and clears the text when invoked.controls/dev/CommonStyles/TestUI/TextControlsPage.xaml— named the test TextBox so the new test can find it.Fixes #7996