Skip to content

Commit

Permalink
Navigation: Select parent navigation block on handleCreateFromExistin…
Browse files Browse the repository at this point in the history
…gPages() action (#19817)
  • Loading branch information
jeryj committed Jan 22, 2020
1 parent 2db504d commit c079120
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block-library/src/navigation/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from '@wordpress/block-editor';

import { createBlock } from '@wordpress/blocks';
import { withSelect, withDispatch } from '@wordpress/data';
import { useDispatch, withSelect, withDispatch } from '@wordpress/data';
import {
Button,
PanelBody,
Expand Down Expand Up @@ -61,6 +61,7 @@ function Navigation( {
//
/* eslint-disable @wordpress/no-unused-vars-before-return */
const ref = useRef();
const { selectBlock } = useDispatch( 'core/block-editor' );

const {
TextColor,
Expand Down Expand Up @@ -127,6 +128,7 @@ function Navigation( {

function handleCreateFromExistingPages() {
updateNavItemBlocks( defaultPagesNavigationItems );
selectBlock( clientId );
}

const hasPages = hasResolvedPages && pages && pages.length;
Expand Down

0 comments on commit c079120

Please sign in to comment.