dotnet / winforms

Windows Forms is a .NET UI framework for building Windows desktop applications.
MIT License
4.4k stars 976 forks source link

[Accessibility] ToolTip shows up in UIA tree as focusable and onscreen after dismissing and has no Name UIA property #3885

Closed John-Qiao closed 4 years ago

John-Qiao commented 4 years ago

More Info: When setting the ToolTip to Form itself, the ToolTip can be focusable using Inspect tool, and no error shows in Accessibility Insights For Windows tool testing result. Inspect-Form AI-Form

Problem description: The ToolTip is not focusable when set it to the control.
AI-control

Expected behavior: The ToolTip should be focusable when set it to the control.

Minimal repro:

  1. Extract “testApp.zip” and open it in VS.
  2. Build and run the project.
  3. Move the mouse on button1 to shows its tooltip text.
  4. Open Accessibility Insights For Windows tool to test that tooltip text of button1. TestApp.zip
SergeySmirnov-Akvelon commented 4 years ago

If I understand correctly, the bug is that when you try to move cursor to the button tooltip, the tooltip disappears, though for the form it continues to be displayed. I think this happens because the tooltip is displayed while the cursor is on the element that the tooltip belongs to. If the button is small, then when you try to focus on the tooltip, the cursor goes beyond the boundaries of the button and the tooltip disappears. I tried to use big button and I was able to hover the Accessibility Insights to the tooltip and get data about it: 3885-AI

The tests were also successful: 3885-tests

John-Qiao commented 4 years ago

@SergeySmirnov-Akvelon yes, when the tooltip text is completely 'included' in the button control, the tooltip text can be focused and no error shows in Accessibility Insights tool testing result. If the tooltip text is partially 'included' in the button control, it can be focused using Accessibility Insights tool too, but the initial error still shows in Accessibility Insights tool testing result. Please check below gif file: TestResult

SergeySmirnov-Akvelon commented 4 years ago

We think that current behavior is expected for tooltip. The moment the tooltip disappears, it stops returning its name. Unfortunately it is behavior of native control by default. 3885-NativeControl If we look in the Inspector, and get the form components again after disappearing of tooltip then we will see that it is not displayed in the component tree 3885-Control This issue does not affect the Narrator, as it annotates the tooltip text during appearing the tooltip. To change the current behavior of "Name" property we will have to add our own AccessibleObject for the tooltip, which will take time and require stabilization. @merriemcgaw could you please share your opinion?

merriemcgaw commented 4 years ago

Closing this issue as by design. This is how the native tooltip and at this point we don't have a way to manage this behavior. We should list this in what our requirements are for the Common Controls team when they enable WCAG2.1 support in the tooltip control.