-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat(react-positioning): simplify maxSize options #28649
Merged
YuanboXue-Amber
merged 14 commits into
microsoft:master
from
YuanboXue-Amber:maxsize-simple
Jul 27, 2023
Merged
feat(react-positioning): simplify maxSize options #28649
YuanboXue-Amber
merged 14 commits into
microsoft:master
from
YuanboXue-Amber:maxsize-simple
Jul 27, 2023
Conversation
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
Perf Analysis (
|
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
FluentProviderWithTheme | mount | 80 | 75 | 10 | Possible regression |
InfoButton | mount | 14 | 19 | 5000 | Possible regression |
All results
Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
---|---|---|---|---|---|
Avatar | mount | 632 | 614 | 5000 | |
Button | mount | 290 | 300 | 5000 | |
Field | mount | 1051 | 1071 | 5000 | |
FluentProvider | mount | 651 | 646 | 5000 | |
FluentProviderWithTheme | mount | 80 | 75 | 10 | Possible regression |
FluentProviderWithTheme | virtual-rerender | 71 | 62 | 10 | |
FluentProviderWithTheme | virtual-rerender-with-unmount | 73 | 82 | 10 | |
InfoButton | mount | 14 | 19 | 5000 | Possible regression |
MakeStyles | mount | 843 | 840 | 50000 | |
Persona | mount | 1632 | 1589 | 5000 | |
SpinButton | mount | 1275 | 1346 | 5000 |
📊 Bundle size reportUnchanged fixtures
|
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 a32e6b5:
|
fabricteam
reviewed
Jul 26, 2023
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 0e9c438b78e58f346f61b15224c7b0020e4fe73e (build) |
ling1726
reviewed
Jul 26, 2023
packages/react-components/react-positioning/src/middleware/maxSize.ts
Outdated
Show resolved
Hide resolved
ling1726
reviewed
Jul 26, 2023
packages/react-components/react-positioning/src/middleware/maxSize.ts
Outdated
Show resolved
Hide resolved
packages/react-components/react-positioning/src/middleware/maxSize.ts
Outdated
Show resolved
Hide resolved
ling1726
reviewed
Jul 26, 2023
packages/react-components/react-positioning/src/utils/normalizeAutoSize.ts
Show resolved
Hide resolved
ling1726
reviewed
Jul 26, 2023
packages/react-components/react-positioning/src/usePositioning.ts
Outdated
Show resolved
Hide resolved
ling1726
approved these changes
Jul 26, 2023
ling1726
reviewed
Jul 26, 2023
packages/react-components/react-positioning/src/middleware/maxSize.ts
Outdated
Show resolved
Hide resolved
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix item 2 in #28623
Previous Behavior
AutoSize has several options:
'height'
- apply max-height only when floating element overflows boundary.'height-always'
- apply max-height regardless of overflow.The same goes with
true
/'always'
and'width'
/'width-always'
.There are two examples in issue 28623 2. Consolidate 'height'/'height-always' option, explaining why we need both set of options.
New Behavior
Options
'always'/'height-always'/'width-always'
are now obsolete, and equivalent totrue/'height'/'width'
.This is achieved by always applying max-height/max-width, but remove them when

updatePosition
is called.The size of the content affects the max-height/max-width style we're applying, because the availableWidth/availableHeight from floating ui
size
middleware is calculated as below:Test cases are added for both case A and case B mentioned in the above issue.
Additionally, this PR fixes 1.b in #28623 by applying overflow style only when overflow styles aren't present. Therefore user can use inline overflow style to override overflow-x/overflow-y added by maxSize.