-
Notifications
You must be signed in to change notification settings - Fork 905
Expose TextBox/NumberBox/AutoSuggestBox clear button to Voice Access #11656
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
Draft
Harini Malothu (HariniMalothu17)
wants to merge
1
commit into
main
Choose a base branch
from
fix/voiceaccess-clear-button-7996
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -278,6 +278,40 @@ public void HyperlinkIsOffscreenTest() | |
| } | ||
| } | ||
|
|
||
| [TestMethod] | ||
| [TestProperty("Description", "Verifies the TextBox inline clear (Delete) button is exposed to UIA so Voice Access can target it.")] | ||
| public void TextBoxClearButtonIsAccessibleTest() | ||
| { | ||
| using (var setup = new TestSetupHelper("TextControls Tests")) | ||
| { | ||
| Edit textBox = new Edit(FindElement.ByName("ClearButtonTextBox")); | ||
| Verify.IsNotNull(textBox, "The test TextBox should be found."); | ||
|
|
||
| // The clear (Delete) button is only shown while the TextBox is focused and non-empty. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the Delete button isn't an immediate child of the Edit's peer, this test silently fails. Suggestion: use the same FindButton(textBox, "Delete") / FindElement.ByName helper for consistency and robustness. |
||
| Log.Comment("Focus the TextBox so the clear (Delete) button becomes visible."); | ||
| textBox.SetFocus(); | ||
| Wait.ForIdle(); | ||
|
|
||
| // The clear button (named "Delete") must be exposed to UIA (and therefore to Voice | ||
| // Access) rather than hidden with AccessibilityView=Raw. Verify it can be found as a | ||
| // child of the TextBox. | ||
| Button deleteButton = null; | ||
| foreach (UIObject elem in textBox.Children) | ||
| { | ||
| if (elem.Name.Equals("Delete")) | ||
| { | ||
| deleteButton = new Button(elem); | ||
| break; | ||
| } | ||
| } | ||
| Verify.IsNotNull(deleteButton, "The clear button should be exposed as a UIA element."); | ||
|
|
||
| Log.Comment("Invoke the clear button and verify that the text is cleared."); | ||
| deleteButton.InvokeAndWait(); | ||
| Verify.AreEqual(string.Empty, textBox.GetText()); | ||
| } | ||
| } | ||
|
|
||
| [TestMethod] | ||
| [TestProperty("Description", "Scrolls a vertical grouped GridView with Mandatory snap points and with the mouse-wheel.")] | ||
| public void ScrollGroupedGridViewWithMandatorySnapPointsTest() | ||
|
|
||
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
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.
This is making different behavior for DeleteButton & QueryButton, I think the guidance for delete operation is to use 'delete' in keyboard only. Please check with accessibility team for the right experience before going ahead
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.
Godly T.Alias (@godlytalias) Voice Access has no keyboard, so the "clear via Delete key" path doesn't serve Voice Access users at all — which is the exact gap #7996 reports. Voice Access acts on elements by name ("Click Delete") or "Show numbers" overlay, and both require the element to be in the UIA tree .Confirmed with accessibility team.
On DeleteButton vs QueryButton: scoped intentionally to #7996; if we want consistency I'll create a new issue for querybutton and address.
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 see that Voice access supports commands to delete text, https://support.microsoft.com/en-us/accessibility/windows/voice-access/voice-access-command-list#edit-text
Moreover the main concern here is that the QueryButton is having the same flags set and this change will make the behavior different for both the buttons