-
Notifications
You must be signed in to change notification settings - Fork 4.7k
DataViews: Avoid flickering while refreshing #74572
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
Changes from all commits
eab75c5
65a9af1
fb003ea
590b60b
0b96de3
be46510
377e043
ba2c3b1
05d1429
b42cbe9
11df542
3e8b361
07dbf7c
a4a8fd9
b81d692
2c3fccd
5981c0a
ac391a9
834fc4d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ export default function DataViewsLayout( { className }: DataViewsLayoutProps ) { | |
| fields, | ||
| getItemId, | ||
| getItemLevel, | ||
| hasInitiallyLoaded, | ||
| isLoading, | ||
| view, | ||
| onChangeView, | ||
|
|
@@ -40,6 +41,10 @@ export default function DataViewsLayout( { className }: DataViewsLayoutProps ) { | |
| empty = <p>{ __( 'No results' ) }</p>, | ||
| } = useContext( DataViewsContext ); | ||
|
|
||
| if ( ! hasInitiallyLoaded ) { | ||
| return null; | ||
| } | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we do this without involving the context (as part of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried that, but there is a tradeoff here. In order to handle properly in one place for both DefaultUI and free composition which renders |
||
|
|
||
| const ViewComponent = VIEW_LAYOUTS.find( | ||
| ( v ) => v.type === view.type && defaultLayouts[ v.type ] | ||
| )?.component as ComponentType< ViewBaseProps< any > >; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.