Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
ellatrix committed Feb 27, 2023
1 parent 0dde423 commit a9b54aa
Showing 1 changed file with 3 additions and 17 deletions.
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

0 comments on commit a9b54aa

Please sign in to comment.