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(Overflow): Update overflow menu when items are removed #31340

Merged

Conversation

miroslavstastny
Copy link
Member

Previous Behavior

In Overflow, when an OverflowItem was removed from the container, the overflow was updated only when the queue of visible items was changed by the removal.
As a result, when an overflowing item was removed, the overflow menu was not updated. Similarly, when all overflow items were removed, the overflow menu was not removed.

New Behavior

Whenever OverflowItem is removed while the Overflow is in observing state, force dispatch is triggered to update the overflow menu. This behavior matches the add logic.

Related Issue(s)

Copy link

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.

@fabricteam
Copy link
Collaborator

Perf Analysis (@fluentui/react-components)

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

Scenario Render type Master Ticks PR Ticks Iterations Status
Avatar mount 617 656 5000
Button mount 297 304 5000
Field mount 1153 1132 5000
FluentProvider mount 708 702 5000
FluentProviderWithTheme mount 82 78 10
FluentProviderWithTheme virtual-rerender 38 34 10 Possible regression
FluentProviderWithTheme virtual-rerender-with-unmount 71 73 10
MakeStyles mount 862 874 50000
Persona mount 1782 1722 5000
SpinButton mount 1405 1395 5000
SwatchPicker mount 1518 1552 5000

@fabricteam
Copy link
Collaborator

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
priority-overflow
createOverflowManager
4.447 kB
1.853 kB
4.457 kB
1.856 kB
10 B
3 B
react-components
react-components: entire library
1.139 MB
275.306 kB
1.139 MB
275.311 kB
10 B
5 B
react-overflow
hooks only
12.86 kB
4.825 kB
12.87 kB
4.83 kB
10 B
5 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
react-breadcrumb
@fluentui/react-breadcrumb - package
117.263 kB
32.241 kB
react-components
react-components: Button, FluentProvider & webLightTheme
71.55 kB
20.584 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
221.825 kB
62.568 kB
react-components
react-components: FluentProvider & webLightTheme
44.037 kB
14.418 kB
react-portal-compat
PortalCompatProvider
8.39 kB
2.64 kB
🤖 This report was generated against 1ccf6c23ddc4d125940ce23ea3788d0069665f67

@fabricteam
Copy link
Collaborator

🕵 fluentuiv9 No visual regressions between this PR and main

@miroslavstastny miroslavstastny changed the title Fix/overflow menu update fix(Overflow): Update overflow menu when items are removed May 13, 2024
@miroslavstastny miroslavstastny merged commit 45cd3f0 into microsoft:master May 13, 2024
19 checks passed
@miroslavstastny miroslavstastny deleted the fix/overflow-menu-update branch May 13, 2024 19:44
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.

[Feature]: Removing overflow items without unmounting an overflow item component
4 participants