Skip to content

Commit

Permalink
Global styles: Reselect blocks after pasting styles (#47590)
Browse files Browse the repository at this point in the history
  • Loading branch information
glendaviesnz authored and Mamaduka committed Feb 3, 2023
1 parent 8a907ca commit fc85b3e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/block-editor/src/components/block-actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ export default function BlockActions( {
setBlockMovingClientId,
setNavigationMode,
selectBlock,
clearSelectedBlock,
multiSelect,
} = useDispatch( blockEditorStore );

const notifyCopy = useNotifyCopy();
Expand Down Expand Up @@ -132,6 +134,13 @@ export default function BlockActions( {
},
async onPasteStyles() {
await pasteStyles( blocks );

// Need to reselect the block(s) in order for optional tool panel control changes to register.
clearSelectedBlock();
multiSelect(
blocks[ 0 ].clientId,
blocks[ blocks.length - 1 ].clientId
);
},
} );
}

0 comments on commit fc85b3e

Please sign in to comment.