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

Make the toolbar menu items support the support space key. #11520

Conversation

SimonZhao888
Copy link
Member

@SimonZhao888 SimonZhao888 commented Jun 12, 2024

Fixes #11449

Proposed changes

  • Modify the ProcessCmdKey() method to support space key.
  • Make a focus on the MenuStrip after the user hits enter to check it.

Customer Impact

  • MenuItems does not respond to the spacebar key to check/uncheck the menu and enter key executes it and closes the menu without focus the menustrip.

Regression?

  • No

Risk

-Minimal

Screenshots

Before

BeforeChanges

After

AfterChanges

Test methodology

  • Manual

Test environment(s)

  • 9.0.100-preview.6.24312.9
Microsoft Reviewers: Open in CodeFlow

Copy link

codecov bot commented Jun 12, 2024

Codecov Report

Attention: Patch coverage is 65.38462% with 9 lines in your changes missing coverage. Please review.

Project coverage is 74.56175%. Comparing base (fc56416) to head (d2966bf).
Report is 83 commits behind head on main.

Additional details and impacted files
@@                 Coverage Diff                 @@
##                main      #11520         +/-   ##
===================================================
+ Coverage   74.39859%   74.56175%   +0.16316%     
===================================================
  Files           3032        3041          +9     
  Lines         628149      629780       +1631     
  Branches       46828       46845         +17     
===================================================
+ Hits          467334      469575       +2241     
+ Misses        157465      156843        -622     
- Partials        3350        3362         +12     
Flag Coverage Δ
Debug 74.56175% <65.38462%> (+0.16316%) ⬆️
integration 17.87556% <3.84615%> (-0.12500%) ⬇️
production 47.45164% <65.38462%> (+0.20467%) ⬆️
test 96.97796% <ø> (+0.01124%) ⬆️
unit 44.55491% <65.38462%> (+0.32596%) ⬆️

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

@dotnet-policy-service dotnet-policy-service bot added the draft draft PR label Jun 12, 2024
@SimonZhao888 SimonZhao888 marked this pull request as ready for review June 14, 2024 06:03
@SimonZhao888 SimonZhao888 requested a review from a team as a code owner June 14, 2024 06:03
@SimonZhao888 SimonZhao888 changed the title Add Space key to ToolStripMenuItem to keep the same behavior with ToolStripButton Make the toolbar menu items support the support space key. Jun 14, 2024
@SimonZhao888 SimonZhao888 removed the draft draft PR label Jun 14, 2024
@elachlan elachlan added the waiting-review This item is waiting on review by one or more members of team label Jun 19, 2024
@ricardobossan
Copy link
Member

All LGTM

@lonitra lonitra added this to the .NET 9.0 milestone Jul 10, 2024
@lonitra lonitra added 📭 waiting-author-feedback The team requires more information from the author and removed waiting-review This item is waiting on review by one or more members of team labels Jul 11, 2024
@dotnet-policy-service dotnet-policy-service bot removed the 📭 waiting-author-feedback The team requires more information from the author label Jul 12, 2024
Copy link
Member

@lonitra lonitra left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@lonitra lonitra added the ready-to-merge PRs that are ready to merge but worth notifying the internal team. label Jul 12, 2024
@SimonZhao888 SimonZhao888 merged commit fa07c1b into dotnet:main Jul 15, 2024
8 checks passed
@dotnet-policy-service dotnet-policy-service bot removed the ready-to-merge PRs that are ready to merge but worth notifying the internal team. label Jul 15, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Aug 14, 2024
@@ -1253,6 +1253,7 @@ protected override void OnItemClicked(ToolStripItemClickedEventArgs e)
|| !(dismissingItem.HasDropDownItems))
{ // clicking on a item w/dropdown does not dismiss window
Close(ToolStripDropDownCloseReason.ItemClicked);
SelectPreviousToolStrip();
Copy link
Member

Choose a reason for hiding this comment

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

@SimonZhao888 - Perhaps this line requires additional checks, sometime focus should not return to the owner item. See #11909

@SimonZhao888 SimonZhao888 deleted the Issue_11449_AddHitSpaceKeyToToolstripMenuItem branch August 22, 2024 06:29
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
6 participants