mirror of
https://github.com/outline/outline.git
synced 2026-01-06 02:59:54 -06:00
fix: Enter in empty heading (#10194)
This commit is contained in:
@@ -23,8 +23,9 @@ export default function splitHeading(type: NodeType): Command {
|
||||
const previousBlockIsCollapsed = !!collapsedNodes.find(
|
||||
(a) => a.pos === previousBlock?.pos
|
||||
);
|
||||
const isEmpty = $from.parent.content.size === 0;
|
||||
|
||||
if (previousBlockIsCollapsed) {
|
||||
if (previousBlockIsCollapsed && !isEmpty) {
|
||||
// Insert a new heading directly before this one
|
||||
const transaction = state.tr.insert(
|
||||
$from.before(),
|
||||
|
||||
Reference in New Issue
Block a user