mirror of
https://github.com/outline/outline.git
synced 2026-12-01 17:32:49 +03:00
Fixed: Creating checklists from block toolbar
This commit is contained in:
1 parent
b794a0cc70
commit
30b2b91bbc
2 files changed
+5
-3
No files matched your search
@@ -25,7 +25,9 @@ export function splitAndInsertBlock(change: Change, options: Options) {
|
||||
}
|
||||
|
||||
if (wrapper) change.collapseToStartOfNextBlock();
|
||||
change.insertBlock(type);
|
||||
|
||||
// this is a hack as insertBlock with normalize: false does not appear to work
|
||||
change.insertBlock('paragraph').setBlock(type, { normalize: false });
|
||||
|
||||
if (wrapper) change.wrapBlock(wrapper);
|
||||
return change;
|
||||
|
||||
@@ -73,9 +73,9 @@ class BlockToolbar extends Component {
|
||||
editor.change(change => {
|
||||
change
|
||||
.collapseToEndOf(this.props.node)
|
||||
.call(splitAndInsertBlock, options)
|
||||
.removeNodeByKey(this.props.node.key)
|
||||
.collapseToEnd()
|
||||
.call(splitAndInsertBlock, options);
|
||||
.collapseToEnd();
|
||||
|
||||
if (cursorPosition === 'before') change.collapseToStartOfPreviousBlock();
|
||||
if (cursorPosition === 'after') change.collapseToStartOfNextBlock();
|
||||
|
||||
Reference in new issue
Block a user