Skip to content

fix: Menu trigger should be focused when dismissed on menuitem click#25289

Merged
ling1726 merged 6 commits intomicrosoft:masterfrom
ling1726:fix/menu-trigger-focus-3
Oct 19, 2022
Merged

fix: Menu trigger should be focused when dismissed on menuitem click#25289
ling1726 merged 6 commits intomicrosoft:masterfrom
ling1726:fix/menu-trigger-focus-3

Conversation

@ling1726
Copy link
Contributor

@ling1726 ling1726 commented Oct 19, 2022

  1. Replaces shouldHandleKeyboardRef with shouldHandlCloseRef so that mouse and keyboard click are handled the same way.
  2. Adds e2e tests for the case "close menu and focus trigger on Space or Enter"

Fixes #24680

Replaces `shouldHandleKeyboardRef` with `shouldHandlCloseRef` so that
mouse and keyboard click are handled the same way.
@bsunderhus bsunderhus assigned ling1726 and unassigned GeoffCoxMSFT Oct 19, 2022
@fabricteam
Copy link
Collaborator

fabricteam commented Oct 19, 2022

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
189.488 kB
52.587 kB
189.44 kB
52.569 kB
-48 B
-18 B
react-menu
Menu (including children components)
116.668 kB
35.792 kB
116.62 kB
35.774 kB
-48 B
-18 B
react-menu
Menu (including selectable components)
119.737 kB
36.316 kB
119.689 kB
36.296 kB
-48 B
-20 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
62.94 kB
17.663 kB
react-components
react-components: FluentProvider & webLightTheme
33.446 kB
11.033 kB
react-portal-compat
PortalCompatProvider
5.857 kB
1.978 kB
🤖 This report was generated against 643aff32bdf62c90367408c060e24b92c6005380

@size-auditor
Copy link

size-auditor bot commented Oct 19, 2022

Asset size changes

Size Auditor did not detect a change in bundle size for any component!

Baseline commit: 643aff32bdf62c90367408c060e24b92c6005380 (build)

@fabricteam
Copy link
Collaborator

fabricteam commented Oct 19, 2022

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1530 1588 5000
Button mount 1115 1146 5000
FluentProvider mount 1911 1877 5000
FluentProviderWithTheme mount 771 754 10
FluentProviderWithTheme virtual-rerender 706 703 10
FluentProviderWithTheme virtual-rerender-with-unmount 743 763 10
MakeStyles mount 2255 2267 50000
SpinButton mount 3026 2986 5000

@codesandbox-ci
Copy link

codesandbox-ci bot commented Oct 19, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit d2f1cef:

Sandbox Source
@fluentui/react 8 starter Configuration
@fluentui/react-components 9 starter Configuration

@ling1726 ling1726 force-pushed the fix/menu-trigger-focus-3 branch from 44fece2 to 31ab432 Compare October 19, 2022 10:31
@ling1726 ling1726 merged commit 099d9f0 into microsoft:master Oct 19, 2022
NotWoods pushed a commit to NotWoods/fluentui that referenced this pull request Nov 18, 2022
…icrosoft#25289)

* fix: Menu trigger should be focused when dismissed on menuitem click

Replaces `shouldHandleKeyboardRef` with `shouldHandlCloseRef` so that
mouse and keyboard click are handled the same way.

* changefiles

* revert overflow changes

* update change file
@ling1726 ling1726 deleted the fix/menu-trigger-focus-3 branch January 4, 2023 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: react-menu doesn't restore focus to the trigger when clicking a menu item

5 participants