Skip to content

Commit

Permalink
Zoom Out: Defalt the inserter in the patterns tab when in zoom out (#…
Browse files Browse the repository at this point in the history
…64193)

Co-authored-by: scruffian <[email protected]>
Co-authored-by: MaggieCabrera <[email protected]>
  • Loading branch information
3 people authored Aug 13, 2024
1 parent f9268de commit ad37f20
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/block-editor/src/components/inserter/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,16 @@ function InserterMenu(
const [ patternFilter, setPatternFilter ] = useState( 'all' );
const [ selectedMediaCategory, setSelectedMediaCategory ] =
useState( null );
const [ selectedTab, setSelectedTab ] = useState(
__experimentalInitialTab
);
function getInitialTab() {
if ( __experimentalInitialTab ) {
return __experimentalInitialTab;
}

if ( isZoomOutMode ) {
return 'patterns';
}
}
const [ selectedTab, setSelectedTab ] = useState( getInitialTab() );

const [ destinationRootClientId, onInsertBlocks, onToggleInsertionPoint ] =
useInsertionPoint( {
Expand Down

0 comments on commit ad37f20

Please sign in to comment.