-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Fully respect skipViewportMeasures in the withViewport decorator
#15963
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
Conversation
| } | ||
| } | ||
|
|
||
| public componentDidUpdate(newProps: TProps) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea why people didn't notice that the contract was wrong here for so long.
packages/office-ui-fabric-react/src/utilities/decorators/withViewport.tsx
Outdated
Show resolved
Hide resolved
|
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 6aec401:
|
6aac50a to
a60e0c7
Compare
Perf AnalysisNo significant results to display. All results
|
Asset size changes
Baseline commit: 922a86f8f337a2fb1d6bf480736aac8118dfffb8 (build) |
packages/office-ui-fabric-react/src/utilities/decorators/withViewport.tsx
Outdated
Show resolved
Hide resolved
a60e0c7 to
38c2f65
Compare
|
Hello @KevinTCoughlin! Because this pull request has the p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (
|
|
🎉 Handy links: |
Description of changes
The expectation of
skipViewportMeasuresonwithViewport(and thus onDetailsList) is that when set, no measurement of the viewport size occurs and thusviewportwill never be set to a non-empty size in thepropsof the wrapped component.However, somewhere along the way,
skipViewportMeasuresgot partially repurposed so that it only disables usage ofResizeObserverand does not fully prevent the wrapped component from re-rendering in response to viewport size changes.This change restores
skipViewportMeasuresto its original intent and how existing apps already expect it to work.This change also fixes the comment in order to explain why to use it.
Focus areas to test
The justified layout behavior of
DetailsListrelies on viewport measurement continuing to work correctly. Test code and 'fixed layout' behaviors rely onskipViewportMeasurescompletely disabling measurment.