fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

feat: use browser `:focus-visible` if supported

Open ling1726 opened this issue 3 years ago • 5 comments

Current Behavior

v9 :focus-visible ponyfill will always be used

New Behavior

Both native :focus-visible and ponyfill styles are written to DOM, but if the ponyfill is never applied, its styles will never be used because there is no selector

:focus-visible native

Changes to :focus-visible will not trigger :focus-within

time elapsed fast reject count match attempts match count
116 0 783 265

:focus-visible ponyfill 🦄

time elapsed fast reject count match attempts match count
377 0 1484 364

:focus-visible Improvement in %

time elapsed fast reject count match attempts match count
69.2% 0% 47.2% 27.2%

Related Issue(s)

Addresses #24183

ling1726 avatar Aug 03 '22 09:08 ling1726

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 bc2f8cbb35aee0e45dd1035e7aec1788faac40e4:

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

codesandbox-ci[bot] avatar Aug 03 '22 09:08 codesandbox-ci[bot]

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-accordion
Accordion (including children components)
79.485 kB
24.082 kB
81.816 kB
24.665 kB
2.331 kB
583 B
react-alert
Alert
82.803 kB
20.582 kB
86.055 kB
21.271 kB
3.252 kB
689 B
react-avatar
AvatarGroup
139.268 kB
41.173 kB
140.849 kB
41.539 kB
1.581 kB
366 B
react-button
Button
36.396 kB
9.575 kB
39.648 kB
10.24 kB
3.252 kB
665 B
react-button
CompoundButton
43.469 kB
10.812 kB
46.721 kB
11.474 kB
3.252 kB
662 B
react-button
MenuButton
39.014 kB
10.456 kB
42.266 kB
11.116 kB
3.252 kB
660 B
react-button
SplitButton
46.506 kB
11.827 kB
50.148 kB
12.65 kB
3.642 kB
823 B
react-button
ToggleButton
51.912 kB
11.004 kB
56.472 kB
11.968 kB
4.56 kB
964 B
react-card
Card - All
67.42 kB
19.249 kB
69.936 kB
19.83 kB
2.516 kB
581 B
react-card
Card
63.102 kB
18.167 kB
65.618 kB
18.747 kB
2.516 kB
580 B
react-combobox
Combobox (including child components)
75.081 kB
24.145 kB
75.123 kB
24.166 kB
42 B
21 B
react-combobox
Dropdown (including child components)
74.594 kB
24.134 kB
74.636 kB
24.155 kB
42 B
21 B
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
192.699 kB
52.786 kB
200.655 kB
54.926 kB
7.956 kB
2.14 kB
react-components
react-components: FluentProvider & webLightTheme
32.688 kB
10.736 kB
32.73 kB
10.757 kB
42 B
21 B
react-dialog
Dialog (including children components)
85.049 kB
25.293 kB
87.422 kB
25.926 kB
2.373 kB
633 B
react-link
Link
12.197 kB
4.912 kB
12.452 kB
4.976 kB
255 B
64 B
react-menu
Menu (including children components)
118.866 kB
36.006 kB
121.239 kB
36.69 kB
2.373 kB
684 B
react-menu
Menu (including selectable components)
122.065 kB
36.499 kB
124.438 kB
37.195 kB
2.373 kB
696 B
react-popover
Popover
106.133 kB
32.244 kB
106.175 kB
32.264 kB
42 B
20 B
react-portal
Portal
10.49 kB
3.845 kB
10.532 kB
3.867 kB
42 B
22 B
react-provider
FluentProvider
15.565 kB
5.818 kB
15.607 kB
5.837 kB
42 B
19 B
react-tooltip
Tooltip
45.509 kB
15.537 kB
45.551 kB
15.558 kB
42 B
21 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-avatar
Avatar
48.533 kB
13.78 kB
react-avatar
AvatarGroupItem
68.248 kB
19.109 kB
react-card
CardFooter
8.461 kB
3.555 kB
react-card
CardHeader
9.504 kB
3.896 kB
react-card
CardPreview
8.562 kB
3.61 kB
react-radio
Radio
36.329 kB
12.024 kB
react-radio
RadioGroup
14.319 kB
5.711 kB
react-slider
Slider
31.988 kB
10.019 kB
react-switch
Switch
32.781 kB
10.348 kB
🤖 This report was generated against a0e1e0c2780ad6ba73aaeee1aa1525168a4d4045

fabricteam avatar Aug 03 '22 09:08 fabricteam

Perf Analysis (@fluentui/react-components)

No significant results to display.

All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 1598 1518 5000
Button mount 1152 1140 5000
FluentProvider mount 1864 1871 5000
FluentProviderWithTheme mount 730 741 10
FluentProviderWithTheme virtual-rerender 729 690 10
FluentProviderWithTheme virtual-rerender-with-unmount 734 755 10
MakeStyles mount 2247 2351 50000
SpinButton mount 3107 3093 5000

fabricteam avatar Aug 03 '22 09:08 fabricteam

Asset size changes

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

Baseline commit: a0e1e0c2780ad6ba73aaeee1aa1525168a4d4045 (build)

size-auditor[bot] avatar Aug 03 '22 09:08 size-auditor[bot]

Waiting on microsoft/keyborg#19 so that we can handle edge cases where screen readers pull focus

ling1726 avatar Aug 10 '22 17:08 ling1726

Because this pull request has not had activity for over 150 days, we're automatically closing it for house-keeping purposes.

The pull request will still be available for reference. If it's still relevant to merge at some point, you can reopen or make a new version based on the latest code.

msft-fluent-ui-bot avatar Apr 02 '23 18:04 msft-fluent-ui-bot