forked from microsoft/fluentui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Overflow update should run show/hide steps twice (microsoft#28628)
* fix: Overflow update should run show/hide steps twice When new items are added to the overflow manager, they are always visible by default. This might not actually be the 'correct' state especially considering priorities. Consider and item that is added whose priority is less than the top of the invisible item queue - it should actually not be visible. This can negatively affect the overflow calculation (which is batched) In order to avoid these other solutions for their negative perf and complexity: * Add more logic to addItem to account for an 'invalid' state * Call `forceUpdate` every time an item is added This PR simply changes the logic to run the hide/show step twice. Which will resolve any new items to their correct state first. In order to improve performance a cache for the offset size was added. This improves the performance even compared to the current version since `offsetWidth` and `offsetHeight` can be called multiple times for a single element in an overflow update. * changefile * fix lint * revert story
- Loading branch information
Showing
4 changed files
with
82 additions
and
36 deletions.
There are no files selected for viewing
7 changes: 7 additions & 0 deletions
7
change/@fluentui-priority-overflow-c98cbac7-b421-4898-a6b9-cd0cf7dfb500.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "fix: Overflow update should run show/hide steps twice", | ||
"packageName": "@fluentui/priority-overflow", | ||
"email": "lingfan.gao@microsoft.com", | ||
"dependentChangeType": "patch" | ||
} |
7 changes: 7 additions & 0 deletions
7
change/@fluentui-react-overflow-87d68562-a91a-45c0-bdd9-133e3a7d2616.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"type": "patch", | ||
"comment": "fix: Overflow update should run show/hide steps twice", | ||
"packageName": "@fluentui/react-overflow", | ||
"email": "lingfan.gao@microsoft.com", | ||
"dependentChangeType": "patch" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters