Skip to content

Commit

Permalink
Fix: Broken columns in Query block
Browse files Browse the repository at this point in the history
  • Loading branch information
tomusborne committed Dec 9, 2024
1 parent 96b33d5 commit b7acfc2
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions src/blocks/looper/components/LoopInnerBlocksRenderer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
} from '@wordpress/block-editor';
import { useSelect } from '@wordpress/data';
import { Spinner } from '@wordpress/components';
import { memo, useEffect, useMemo, useState, Children } from '@wordpress/element';
import { memo, useEffect, useMemo, useState } from '@wordpress/element';
import { applyFilters, addAction } from '@wordpress/hooks';
import apiFetch from '@wordpress/api-fetch';

Expand Down Expand Up @@ -178,11 +178,6 @@ export function LoopInnerBlocksRenderer( props ) {
}
);

const {
children: innerBlocksChildren,
...otherInnerBlocksProps
} = innerBlocksProps;

const loopItemsContext = useMemo( () => {
if ( hasResolvedData && Array.isArray( data ) ) {
let { posts_per_page: perPage = 10, offset = 0 } = query;
Expand Down Expand Up @@ -266,16 +261,12 @@ export function LoopInnerBlocksRenderer( props ) {
key={ key }
value={ loopItemContext }
>
{ ( isActive && Children.count( innerBlocksChildren ) )
? innerBlocksChildren
: (
<div { ...otherInnerBlocksProps } />
) }
{ isActive && innerBlocksProps.children }
<MemoizedBlockPreview
blocks={ innerBlocks }
isHidden={ isActive }
/>
</BlockContextProvider>
);
} ) : innerBlocksChildren;
} ) : innerBlocksProps.children;
}

0 comments on commit b7acfc2

Please sign in to comment.