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

wip #48499

Closed
wants to merge 1 commit into from
Closed

wip #48499

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 3 additions & 17 deletions packages/block-editor/src/components/block-list/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,11 @@ function Items( {
__experimentalAppenderTagName,
__experimentalLayout: layout = defaultLayout,
} ) {
const { order, selectedBlocks, visibleBlocks } = useSelect(
const { order } = useSelect(
( select ) => {
const {
getBlockOrder,
getSelectedBlockClientIds,
__unstableGetVisibleBlocks,
} = select( blockEditorStore );
const { getBlockOrder } = select( blockEditorStore );
return {
order: getBlockOrder( rootClientId ),
selectedBlocks: getSelectedBlockClientIds(),
visibleBlocks: __unstableGetVisibleBlocks(),
};
},
[ rootClientId ]
Expand All @@ -163,15 +157,7 @@ function Items( {
return (
<LayoutProvider value={ layout }>
{ order.map( ( clientId ) => (
<AsyncModeProvider
key={ clientId }
value={
// Only provide data asynchronously if the block is
// not visible and not selected.
! visibleBlocks.has( clientId ) &&
! selectedBlocks.includes( clientId )
}
>
<AsyncModeProvider key={ clientId } value={ true }>
<BlockListBlock
rootClientId={ rootClientId }
clientId={ clientId }
Expand Down