Skip to content

Commit

Permalink
Adding new text block via dropdown when current block is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
Abhishek-17h committed Jan 12, 2025
1 parent 1c88feb commit 6b0dcb7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/volto/news/6574.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
You can now add a text block by clicking the circled `+` icon ("Add" block button) and selecting "Text" from the pop-up menu. Previously no text block would be inserted. @Abhishek-17h
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,15 @@ const BlockChooserButton = (props) => {
onInsertBlock={
onInsertBlock
? (id, value) => {
if (
data['@type'] === value['@type'] &&
value['@type'] === 'slate'
) {
onMutateBlock(block, { ...data, ...value });
} else {
onInsertBlock(id, value);
}
setAddNewBlockOpened(false);
onInsertBlock(id, value);
}
: null
}
Expand Down

0 comments on commit 6b0dcb7

Please sign in to comment.