dotnet / winforms

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

When we hit ENTER key to check/uncheck the checkbox present under 'ToolstripMenuItem1' dropdown is getting closed and keyboard focus loss is observed: A11y_.NET CoreWinforms_StripControls_Toolstripwithmenuitem_Keyboard #11449

Open PoojaNamde opened 1 month ago

PoojaNamde commented 1 month ago

.NET version

dotnet-sdk-9.0.100-preview.5.24258.1

Did it work in .NET Framework?

Yes

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

No response

Issue description

GitHub Tags:

A11yMAS; #A11yTCS; #A11ySev2; #BM_.NET Core[Winforms]_Win32_May2024; #.NETCore; #WCAG2.4.3; #DesktopApp; #Win11; #FTP; #Keyboard;

Environment Details:

App name: .NET Core Winforms Window Version: Win 11 OS Build: 22621.3085

Repro Steps:

  1. Launch the "Accessibility core app".
  2. Main Form screen would appear.
  3. TAB to "MenuToolbars_Controls:Testing the controls under Menu Toolbars Tab" and hit ENTER key.
  4. TAB to StripControls button and hit ENTER key.
  5. TAB to Toolstripwithmenuitem1 and hit ENTER key.
  6. Try to check/ uncheck the checkbox using ENTER key and observe the issue.

Actual Result:

When we hit ENTER key to check/uncheck the checkbox present under 'ToolstripMenuItem1' dropdown is getting closed and keyboard focus loss is observed.

Expected Result:

When we hit ENTER key to check/uncheck the checkbox present under 'ToolstripMenuItem1' dropdown should not get closed and keyboard focus should remain on the checkbox.

User Impact:

Keyboard users will face difficulty while interacting with the control as its getting closed and focus is moving to other controls.

Attachment

https://github.com/dotnet/winforms/assets/90901519/2ed613c4-ecf8-4f9b-a331-e4b3c5c7d23c

Yash14j commented 1 month ago

GithubTags:#Rev:yaja;

MelonWang1 commented 1 month ago

For DropDownMenu, menu items close the menu by default when clicked and focus moves between controls within the application. This is a common issue in VS and windows application.

merriemcgaw commented 1 month ago

@MelonWang1 can you check to see if spacebar works in this case? I think it should. In which case I don't think this bug is valid.

MelonWang1 commented 1 month ago

@merriemcgaw In the MenuStrip control, the space bar does not work. In the ToolStrip control, the space bar works. See the video.

https://github.com/dotnet/winforms/assets/94418985/13e6f131-32b9-4f16-9ac6-c733b17c78ae

merriemcgaw commented 4 weeks ago

@Tanya-Solyanik this seems like something that may be worth changing - checked MenuItems maybe should respond to the spacebar key to check/uncheck the menu and enter executes it and closes the menu.

Visual Studio does have this behavior in the Window menu, but it feels off to me (show tabs in Sidebar or something like that). We could take this one to Office Hours.

merriemcgaw commented 3 weeks ago

@SimonZhao888 - I spoke with the SMEs and they love the idea of the space bar working to check and uncheck the menu without making the MenuStrip lose focus. Also, please make sure there is a visible focus indicator on the form after the user hits enter to check it (and close the MenuStrip).