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

fix(Menu): Do not rely on tabster restorer for focus restore #32840

Merged
merged 4 commits into from
Sep 23, 2024

Conversation

ling1726
Copy link
Member

@ling1726 ling1726 commented Sep 16, 2024

The restorer can cause unintended focus switching whenever other restore sources lose focus to body. In internal discussions with @jurokapsiar we decided that it would be better to allow lost focus to body in applications rather than unexpected focus switches.

There are no changes to Popover or Dialog because those previously used Deloser as a part of attributes and there was never imperative focus restore on those components

Previous Behavior

The Menu used Tabster Restorer API to restore focus to the trigger

New Behavior

Reverts Menu to restore focus manually pre - #28530. However the restorer source is still kept on the MenuPopover to make sure that users can still use Menu without a trigger easily.

@fabricteam
Copy link
Collaborator

fabricteam commented Sep 16, 2024

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
218.197 kB
63.203 kB
218.317 kB
63.258 kB
120 B
55 B
react-components
react-components: entire library
1.1 MB
271.983 kB
1.1 MB
272.008 kB
164 B
25 B
react-menu
Menu (including children components)
151.856 kB
45.848 kB
152.025 kB
45.914 kB
169 B
66 B
react-menu
Menu (including selectable components)
154.537 kB
46.326 kB
154.706 kB
46.397 kB
169 B
71 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-avatar
Avatar
49.303 kB
15.815 kB
react-avatar
AvatarGroup
20.106 kB
7.968 kB
react-avatar
AvatarGroupItem
63.447 kB
20.034 kB
react-breadcrumb
@fluentui/react-breadcrumb - package
113.699 kB
31.498 kB
react-components
react-components: Button, FluentProvider & webLightTheme
69.14 kB
20.137 kB
react-components
react-components: FluentProvider & webLightTheme
44.447 kB
14.59 kB
react-datepicker-compat
DatePicker Compat
223.64 kB
63.299 kB
react-dialog
Dialog (including children components)
99.724 kB
29.912 kB
react-overflow
hooks only
12.808 kB
4.819 kB
react-persona
Persona
56.194 kB
17.695 kB
react-popover
Popover
128.329 kB
40.143 kB
react-portal-compat
PortalCompatProvider
8.39 kB
2.64 kB
react-table
DataGrid
160.471 kB
45.539 kB
react-table
Table (Primitives only)
42.643 kB
13.82 kB
react-table
Table as DataGrid
131.325 kB
36.373 kB
react-table
Table (Selection only)
70.512 kB
19.965 kB
react-table
Table (Sort only)
69.155 kB
19.576 kB
react-tag-picker
@fluentui/react-tag-picker - package
183.584 kB
55.264 kB
react-tags
InteractionTag
15.199 kB
6.157 kB
react-tags
Tag
29.016 kB
9.524 kB
react-tags
TagGroup
82.197 kB
24.362 kB
react-timepicker-compat
TimePicker
107.387 kB
35.758 kB
🤖 This report was generated against c189a92730fbf4befd28fad97fc27638c277207d

@fabricteam
Copy link
Collaborator

fabricteam commented Sep 16, 2024

Perf Analysis (@fluentui/react-components)

Scenario Render type Master Ticks PR Ticks Iterations Status
FluentProviderWithTheme virtual-rerender 35 37 10 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 652 626 5000
Button mount 292 319 5000
Field mount 1128 1149 5000
FluentProvider mount 716 724 5000
FluentProviderWithTheme mount 84 93 10
FluentProviderWithTheme virtual-rerender 35 37 10 Possible regression
FluentProviderWithTheme virtual-rerender-with-unmount 80 87 10
MakeStyles mount 879 890 50000
Persona mount 1781 1778 5000
SpinButton mount 1381 1413 5000
SwatchPicker mount 1666 1635 5000

@ling1726 ling1726 marked this pull request as ready for review September 23, 2024 09:31
@ling1726 ling1726 requested a review from a team as a code owner September 23, 2024 09:31
@ling1726 ling1726 merged commit 1a4a95e into microsoft:master Sep 23, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants