Skip to content

fix(react-combobox): close controlled dropdown by clicking outside#31786

Merged
dmytrokirpa merged 19 commits into
microsoft:masterfrom
dmytrokirpa:fix-controlled-dropdown-close-on-click-outside
Jun 28, 2024
Merged

fix(react-combobox): close controlled dropdown by clicking outside#31786
dmytrokirpa merged 19 commits into
microsoft:masterfrom
dmytrokirpa:fix-controlled-dropdown-close-on-click-outside

Conversation

@dmytrokirpa

Copy link
Copy Markdown
Contributor

Previous Behavior

Controlled dropdown & combobox cannot get dismissed by clicking outside

New Behavior

Controlled dropdown & combobox get dismissed by clicking outside

Related Issue(s)

@fabricteam

fabricteam commented Jun 21, 2024

Copy link
Copy Markdown
Collaborator

Perf Analysis (@fluentui/react-components)

Scenario Render type Master Ticks PR Ticks Iterations Status
FluentProviderWithTheme virtual-rerender-with-unmount 84 80 10 Possible regression
All results

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 625 640 5000
Button mount 308 301 5000
Field mount 1146 1113 5000
FluentProvider mount 702 712 5000
FluentProviderWithTheme mount 87 79 10
FluentProviderWithTheme virtual-rerender 30 33 10
FluentProviderWithTheme virtual-rerender-with-unmount 84 80 10 Possible regression
MakeStyles mount 869 860 50000
Persona mount 1770 1735 5000
SpinButton mount 1389 1339 5000
SwatchPicker mount 1643 1669 5000

@fabricteam

fabricteam commented Jun 21, 2024

Copy link
Copy Markdown
Collaborator

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react-combobox
Combobox (including child components)
101.39 kB
33.324 kB
103.467 kB
33.927 kB
2.077 kB
603 B
react-combobox
Dropdown (including child components)
102.028 kB
33.263 kB
104.094 kB
33.85 kB
2.066 kB
587 B
react-components
react-components: entire library
1.094 MB
270.664 kB
1.094 MB
270.732 kB
195 B
68 B
react-timepicker-compat
TimePicker
104.384 kB
34.782 kB
106.455 kB
35.452 kB
2.071 kB
670 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-components
react-components: Button, FluentProvider & webLightTheme
69.141 kB
20.157 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
211.741 kB
60.957 kB
react-components
react-components: FluentProvider & webLightTheme
44.442 kB
14.607 kB
react-portal-compat
PortalCompatProvider
8.39 kB
2.64 kB
react-tag-picker
@fluentui/react-tag-picker - package
181.136 kB
54.463 kB
🤖 This report was generated against 4c22606e2245ec8a172d070433bc4522818ce942

@dmytrokirpa
dmytrokirpa marked this pull request as ready for review June 21, 2024 15:02
@dmytrokirpa
dmytrokirpa requested review from a team and smhigley as code owners June 21, 2024 15:02
@mainframev

Copy link
Copy Markdown
Contributor

@dmytrokirpa

I think storybook example should be adjusted with focus, in controlled case it's not automatically focused, so later key navigation is not possible and when hitting ESC it's not closing 🙂

@dmytrokirpa
dmytrokirpa force-pushed the fix-controlled-dropdown-close-on-click-outside branch from a56c576 to ccd6d2c Compare June 22, 2024 08:02
@dmytrokirpa

dmytrokirpa commented Jun 22, 2024

Copy link
Copy Markdown
Contributor Author

@dmytrokirpa

I think storybook example should be adjusted with focus, in controlled case it's not automatically focused, so later key navigation is not possible and when hitting ESC it's not closing 🙂

Nice catch, thank you @mainframev. I've added focus management to new stories.

@dmytrokirpa
dmytrokirpa force-pushed the fix-controlled-dropdown-close-on-click-outside branch from 6280ff7 to 6c1bc6a Compare June 24, 2024 09:04
@dmytrokirpa
dmytrokirpa force-pushed the fix-controlled-dropdown-close-on-click-outside branch from 2a7ebce to a67c6f5 Compare June 25, 2024 07:58
@marcosmoura
marcosmoura self-requested a review June 25, 2024 11:34
Comment thread packages/react-components/react-combobox/stories/src/utils/useDebounce.ts Outdated
@dmytrokirpa
dmytrokirpa requested a review from a team as a code owner June 26, 2024 12:41
@dmytrokirpa
dmytrokirpa force-pushed the fix-controlled-dropdown-close-on-click-outside branch from 9bcf3c6 to a5bc691 Compare June 28, 2024 10:22
@dmytrokirpa
dmytrokirpa merged commit 8a3aa5f into microsoft:master Jun 28, 2024
@dmytrokirpa
dmytrokirpa deleted the fix-controlled-dropdown-close-on-click-outside branch June 28, 2024 12:56
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]: open-state-controlled Dropdown cannot get dismissed by clicking outside the dropdown button

7 participants