Skip to content

Commit

Permalink
Add support for newId returned by onMutateBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
avoinea committed Apr 5, 2021
1 parent d53cfb5 commit 4030d3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/ColumnsBlock/EditBlockWrapper.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class EditBlockWrapper extends React.Component {
allowedBlocks,
block,
data,
onSelectBlock,
onDeleteBlock,
onMutateBlock,
selected,
Expand Down Expand Up @@ -140,7 +141,8 @@ class EditBlockWrapper extends React.Component {
<BlockChooser
onMutateBlock={(id, value) => {
this.setState({ addNewBlockOpened: false });
onMutateBlock(id, value);
const newId = onMutateBlock(id, value);
newId && onSelectBlock(newId);
}}
currentBlock={block}
allowedBlocks={allowedBlocks}
Expand Down

0 comments on commit 4030d3c

Please sign in to comment.