Skip to content

Commit

Permalink
show preview in search results (#27193)
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras authored Nov 26, 2020
1 parent 007dd62 commit 77ef788
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
1 change: 1 addition & 0 deletions packages/block-editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ function InserterMenu( {
<InserterSearchResults
filterValue={ filterValue }
onSelect={ onSelect }
onHover={ onHover }
rootClientId={ rootClientId }
clientId={ clientId }
isAppender={ isAppender }
Expand Down
11 changes: 4 additions & 7 deletions packages/block-editor/src/components/inserter/search-results.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { searchBlockItems, searchItems } from './search-items';
function InserterSearchResults( {
filterValue,
onSelect,
onHover,
rootClientId,
clientId,
isAppender,
Expand All @@ -38,11 +39,7 @@ function InserterSearchResults( {
} ) {
const debouncedSpeak = useDebounce( speak, 500 );

const [
destinationRootClientId,
onInsertBlocks,
onToggleInsertionPoint,
] = useInsertionPoint( {
const [ destinationRootClientId, onInsertBlocks ] = useInsertionPoint( {
onSelect,
rootClientId,
clientId,
Expand Down Expand Up @@ -117,7 +114,7 @@ function InserterSearchResults( {
<BlockTypesList
items={ filteredBlockTypes }
onSelect={ onSelectBlockType }
onHover={ onToggleInsertionPoint }
onHover={ onHover }
label={ __( 'Blocks' ) }
/>
</InserterPanel>
Expand Down Expand Up @@ -150,7 +147,7 @@ function InserterSearchResults( {
<__experimentalInserterMenuExtension.Slot
fillProps={ {
onSelect: onSelectBlockType,
onHover: onToggleInsertionPoint,
onHover,
filterValue,
hasItems,
} }
Expand Down

0 comments on commit 77ef788

Please sign in to comment.