diff --git a/packages/block-editor/src/store/reducer.js b/packages/block-editor/src/store/reducer.js index 5c30089af2ac3..68f0f9b684e95 100644 --- a/packages/block-editor/src/store/reducer.js +++ b/packages/block-editor/src/store/reducer.js @@ -1738,7 +1738,7 @@ export function highlightedBlock( state, action ) { export function lastBlockInserted( state = {}, action ) { switch ( action.type ) { case 'INSERT_BLOCKS': - if ( ! action.updateSelection || ! action.blocks.length ) { + if ( ! action.blocks.length ) { return state; } diff --git a/packages/block-editor/src/store/test/reducer.js b/packages/block-editor/src/store/test/reducer.js index fd5e06d06c850..13e6fe57ae980 100644 --- a/packages/block-editor/src/store/test/reducer.js +++ b/packages/block-editor/src/store/test/reducer.js @@ -2960,7 +2960,6 @@ describe( 'state', () => { source: 'inserter_menu', }, type: 'INSERT_BLOCKS', - updateSelection: true, }; const state = lastBlockInserted( {}, action ); @@ -2981,7 +2980,6 @@ describe( 'state', () => { source: expectedSource, }, type: 'INSERT_BLOCKS', - updateSelection: true, }; const state = lastBlockInserted( {}, action ); @@ -2989,29 +2987,6 @@ describe( 'state', () => { expect( state.source ).toBe( expectedSource ); } ); - it( 'should return state if last block inserted is called with action INSERT_BLOCKS that is not a updateSelection', () => { - const expectedState = { - clientId: '9db792c6-a25a-495d-adbd-97d56a4c4189', - }; - - const action = { - blocks: [ - { - clientId: '62bfef6e-d5e9-43ba-b7f9-c77cf354141f', - }, - ], - meta: { - source: 'inserter_menu', - }, - type: 'INSERT_BLOCKS', - updateSelection: false, - }; - - const state = lastBlockInserted( expectedState, action ); - - expect( state ).toEqual( expectedState ); - } ); - it( 'should return state if last block inserted is called with action INSERT_BLOCKS and block list is empty', () => { const expectedState = { clientId: '9db792c6-a25a-495d-adbd-97d56a4c4189', @@ -3023,7 +2998,6 @@ describe( 'state', () => { source: 'inserter_menu', }, type: 'INSERT_BLOCKS', - updateSelection: true, }; const state = lastBlockInserted( expectedState, action );