Skip to content

Commit

Permalink
Quick Inserter: Restore pattern search and insertion (WordPress#69028)
Browse files Browse the repository at this point in the history
Unlinked contributors: xpurichan.

Co-authored-by: Mamaduka <[email protected]>
Co-authored-by: t-hamano <[email protected]>
Co-authored-by: yogeshbhutkar <[email protected]>
Co-authored-by: fabiankaegy <[email protected]>
  • Loading branch information
5 people authored Feb 6, 2025
1 parent 9b90569 commit 96b12e5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { store as blockEditorStore } from '../../store';

const SEARCH_THRESHOLD = 6;
const SHOWN_BLOCK_TYPES = 6;
const SHOWN_BLOCK_PATTERNS = 2;

export default function QuickInserter( {
onSelect,
Expand Down Expand Up @@ -106,7 +107,9 @@ export default function QuickInserter( {
rootClientId={ rootClientId }
clientId={ clientId }
isAppender={ isAppender }
maxBlockPatterns={ 0 }
maxBlockPatterns={
!! filterValue ? SHOWN_BLOCK_PATTERNS : 0
}
maxBlockTypes={ SHOWN_BLOCK_TYPES }
isDraggable={ false }
selectBlockOnInsert={ selectBlockOnInsert }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,9 @@ function InserterSearchResults( {
] = useBlockTypesState( destinationRootClientId, onInsertBlocks, isQuick );
const [ patterns, , onClickPattern ] = usePatternsState(
onInsertBlocks,
destinationRootClientId
destinationRootClientId,
undefined,
isQuick
);

const filteredBlockPatterns = useMemo( () => {
Expand Down

0 comments on commit 96b12e5

Please sign in to comment.