Skip to content
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

Add UIA_AutomationFocusChangedEventId to SelectInternal of the TextBoxBase.cs #12479

Merged

Conversation

LeafShi1
Copy link
Member

@LeafShi1 LeafShi1 commented Nov 14, 2024

Fixes #12421

Root Cause:

The highlighted part cannot be read completely because when using the up and down keys to switch options, the AI ​​rectangle does not refocus the current edit text box, but directly switches from the rectangle of the previous option to the current rectangle size, as shown in the figure below

VeriftWithNarrator

So the idea of ​​repairing it is to focus the AI ​​rectangle to the position (0, 0) first when executing CommitValue, and then focus on the new value

Proposed changes

  • Add a check in SelectInternal of the TextBoxBase that when the selected text is (0, 0), let the AI ​​rectangle refocus the current text box

Customer Impact

  • When switching the items by using up/down keyboard arrow that without expand the dropdown list panel, Narrator announced the property item entirety.

Regression?

  • Yes

Risk

  • Minimal

Screenshots

Before

When switching the items by using up/down keyboard arrow that without expand the dropdown list panel, Narrator can not announced the property item entirety.
image

After

When switching the items by using up/down keyboard arrow that without expand the dropdown list panel, Narrator announced the property item entirety.
image

Test methodology

  • Manually

Test environment(s)

  • .net 10.0.0-alpha.1.24562.13
Microsoft Reviewers: Open in CodeFlow

@LeafShi1 LeafShi1 requested a review from a team as a code owner November 14, 2024 07:44
@LeafShi1
Copy link
Member Author

LeafShi1 commented Nov 14, 2024

There have extra "item selected" is announced for BackColor/ForeColor/Cursor property with Narrator when using commit1
the issue doesn't reproduce in NVDA tools

image

Copy link

codecov bot commented Nov 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.73942%. Comparing base (af49f16) to head (598a854).
Report is 71 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #12479         +/-   ##
===================================================
+ Coverage   75.73242%   75.73942%   +0.00699%     
===================================================
  Files           3153        3157          +4     
  Lines         635807      636106        +299     
  Branches       46975       47004         +29     
===================================================
+ Hits          481512      481783        +271     
+ Misses        150870      150866          -4     
- Partials        3425        3457         +32     
Flag Coverage Δ
Debug 75.73942% <100.00000%> (+0.00699%) ⬆️
integration 18.18220% <100.00000%> (-0.07233%) ⬇️
production 49.30429% <100.00000%> (-0.00123%) ⬇️
test 97.04535% <ø> (-0.00459%) ⬇️
unit 46.48974% <85.71429%> (+0.22666%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

@LeafShi1 LeafShi1 added the waiting-review This item is waiting on review by one or more members of team label Nov 15, 2024
@LeafShi1 LeafShi1 marked this pull request as draft November 15, 2024 10:14
@dotnet-policy-service dotnet-policy-service bot added the draft draft PR label Nov 15, 2024
@LeafShi1 LeafShi1 marked this pull request as ready for review November 19, 2024 01:42
@LeafShi1 LeafShi1 removed the draft draft PR label Nov 19, 2024
Copy link
Member

@ricardobossan ricardobossan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I proceeded to test the PR code and this was the result:

Captura de tela 2024-11-19 224356
12479

@LeafShi1 LeafShi1 changed the title Override SelectInternal to add UIA_AutomationFocusChangedEventId in PropertyGridView.GridViewTextBox Add UIA_AutomationFocusChangedEventId to SelectInternal of the TextBoxBase.cs Nov 22, 2024
@Tanya-Solyanik Tanya-Solyanik added waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) and removed waiting-review This item is waiting on review by one or more members of team labels Nov 27, 2024
@LeafShi1 LeafShi1 added waiting-review This item is waiting on review by one or more members of team and removed waiting-for-testing The PR is awaiting manual testing by the primary team; no action is yet required from the author(s) labels Nov 29, 2024
Copy link
Member

@Tanya-Solyanik Tanya-Solyanik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, please port to release/9.0 and send the new PR to test.

@LeafShi1 LeafShi1 merged commit 9bd76c9 into dotnet:main Dec 9, 2024
8 checks passed
@LeafShi1 LeafShi1 deleted the Issue_12421_fix_Narrator_announced_incomplete branch December 9, 2024 09:28
@dotnet-policy-service dotnet-policy-service bot added this to the 10.0 Preview1 milestone Dec 9, 2024
@dotnet-policy-service dotnet-policy-service bot removed the waiting-review This item is waiting on review by one or more members of team label Dec 9, 2024
LeafShi1 added a commit to LeafShi1/winforms that referenced this pull request Dec 9, 2024
…xBase.cs (dotnet#12479)

* Add UIA_AutomationFocusChangedEventId in SelectInternal function of  PropertyGridView.GridViewTextBox

* Add a check that when the selected text is (0, 0), let the AI ​​rectangle refocus the current text box

* Rename the variables of function SelectInternal
Tanya-Solyanik pushed a commit that referenced this pull request Jan 9, 2025
…r experience in dropdown type editors in property grid (#12605)

Backport of #12508, #12431, #12356 and #12479 to release/9.0
Fixes #12607
NET10 Bugs: #12434, #12421, #12440, #12031

Bug Description
There are four issues that occur when using the up/down keys to switch property values ​​in the property page.

When navigating to "Auto Size" dropdown using the up/down arrow keys, it is getting auto selected without hitting ENTER

After using Tab to switch property values, then using the up/down keys to switch items in the drop-down box expanded by F4 will cause the drop-down box to collapse directly

[Accessibility] When using up/down to toggle property value on edit text box, The Accessibility ​​rectangle focuses on the entire property row instead of the original edit text box

[Accessibility] Narrator cannot announce items correctly when switching the items by using up/down keyboard arrow that without expand the dropdown list panel

Customer Impact
PropertyGrid drop down type editor does not support conventional keyboard navigation. Usually, selection is committed when the ENTER key is pressed. However, in this case value is committed on the Down arrow press. Then the drop down list is expanded, the screen reader user might want to navigate through all values in the drop down using the arrows, on each arrow key press the new item should be presented (and announced) in the selection text box, however, the drop down is closed on the first arrow key. According to the accessibility SMEs, this is a major problem - the keyboard users are losing their work by committing a wrong value. Screen reader user don't get correct feedback when navigating through the drop down list.
@github-actions github-actions bot locked and limited conversation to collaborators Jan 9, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
3 participants