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

[Accessibility] NVDA tool does not show focus blue rectangle in property edit #12565

Open
MelonWang1 opened this issue Nov 29, 2024 · 10 comments · Fixed by #12651
Open

[Accessibility] NVDA tool does not show focus blue rectangle in property edit #12565

MelonWang1 opened this issue Nov 29, 2024 · 10 comments · Fixed by #12651
Assignees
Labels
💥 regression-release Regression from a public release 🚧 work in progress Work that is current in progress tenet-accessibility MAS violation, UIA issue; problems with accessibility standards
Milestone

Comments

@MelonWang1
Copy link
Contributor

MelonWang1 commented Nov 29, 2024

.NET version

.NET 10.0.100-alpha.1.24573.1

Did it work in .NET Framework?

Yes

Did it work in any of the earlier releases of .NET Core or .NET 5+?

Yes, also can repro in .NET8.0/9.0, cannot repro in .NET 6.0/7.0.

Issue description

Current Behavior

NVDA does not show focus blue rectangle.
Image

10.0mp4.mp4

Expected Behavior

NVDA should show focus blue rectangle.
In .NET7.0/6.0:
Image

6.0mp4.mp4

In .NET Framework:

Image

Steps to reproduce

  1. Create a .NET Core Winforms project.
  2. Add a Button and PropertyGrid controls in form designer.
  3. Set the SelectedObject property to Button1 in propertyGrid1 control.
  4. Build and run project.
  5. Open NVDA tool and select FlatStyle property in propertyGrid control.
  6. Press Tab (should focus on edit part)
@MelonWang1 MelonWang1 added 💥 regression-release Regression from a public release untriaged The team needs to look at this issue in the next triage labels Nov 29, 2024
@elachlan elachlan added the tenet-accessibility MAS violation, UIA issue; problems with accessibility standards label Nov 29, 2024
@merriemcgaw merriemcgaw added this to the .NET 10.0 milestone Dec 3, 2024
@merriemcgaw merriemcgaw removed the untriaged The team needs to look at this issue in the next triage label Dec 3, 2024
@LeafShi1
Copy link
Member

LeafShi1 commented Dec 4, 2024

@MelonWang1 Could you please test if the issue is related to the version of NAVD and confirm if the issue occurs in Narrator or JAWS?

@MelonWang1
Copy link
Contributor Author

@LeafShi1 This issue cannot repro in Narrator tool, can repro in latest NVDA tool version 2024.4.1.
Narrator:
Image

NVDA:
Image

@LeafShi1
Copy link
Member

LeafShi1 commented Dec 4, 2024

This issue caused by the changes in PR #9321

@ricardobossan
Copy link
Member

This issue caused by the changes in PR #9321

@Tanya-Solyanik I tried reverting the PR, and it did resolve the issue, so @LeafShi1 is spot on!

However, the conversion from User32 to CsWin32 was a massive shift. Most of the specific changes across the 190 files can’t be individually reverted to isolate the trigger for the issue, as they rely on the old User32 methods and properties that no longer exist. It’s like flipping a switch: either everything works or nothing does.

Given that, it’s really difficult to pinpoint what specifically affected the NVDA functionality in this PR. I’m at a bit of a loss on how to approach this. Any suggestions or thoughts on next steps?

@LeafShi1
Copy link
Member

LeafShi1 commented Dec 16, 2024

This issue seems to be because the MSAA event is not triggered, resulting in the GridViewTextBox's state cannot be read by NVDA.
Image

I tried to add the event AccessibilityNotifyClients(AccessibleEvents.Focus, 0, -1); in method GridViewTextBox.OnGotFocus(), but the following exception is thrown during the code running

Image

@ricardobossan Please verify whether we can add MSAA events to GridViewTextBox before #9321

@ricardobossan
Copy link
Member

@LeafShi1 I checked out the commit right before PR #9321 and added the following line to the GridViewTextBox.OnGotFocus() method:

AccessibilityNotifyClients(AccessibleEvents.Focus, 0, -1);

After adding this, I tested the reproduction steps while debugging. However, no error was thrown, and the issue did not reproduce for me.

Image

@chaowendy
Copy link
Contributor

Verified this issue in the latest .NET 10.0 SDK build: 10.0.100-alpha.1.24623.6 + private dlls built from the main branch of Winforms repo, now NVDA show focus blue rectangle in property edit.
Image

But there is a regression issue that each option will be read three times, and from alphanumeric long to short the last time will be announced extra word "instead", for example from 'Flat' to 'System', will be read once "System selected instead".
Image

which is only read once before.
Image

@chaowendy chaowendy reopened this Dec 26, 2024
@LeafShi1
Copy link
Member

The last time announced extra word "instead" is caused by the code

PInvokeCore.SendMessage(this, PInvokeCore.EM_SETSEL, (WPARAM)start, (LPARAM)end);

@LeafShi1
Copy link
Member

@JeremyKuhne Can you take a look at this issue, it is a regression caused by PR #9321

After I added MSAA events(PR #12651) to the control, the NVDA rectangle can focus on the property edit box, but before PR #9321, we don't need to add this extra MSAA event. And adding this event will cause NVDA to read the edit box information three times.

@LeafShi1
Copy link
Member

The root cause in Control.ControlAccessibleObject.cs

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💥 regression-release Regression from a public release 🚧 work in progress Work that is current in progress tenet-accessibility MAS violation, UIA issue; problems with accessibility standards
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants