diff --git a/packages/slate/src/interfaces/editor/transforms/node.ts b/packages/slate/src/interfaces/editor/transforms/node.ts index f8e94b81c..79487ca33 100644 --- a/packages/slate/src/interfaces/editor/transforms/node.ts +++ b/packages/slate/src/interfaces/editor/transforms/node.ts @@ -656,7 +656,7 @@ export const NodeTransforms = { } Editor.setNodes(editor, obj, options) - } + }, /** * Unwrap the nodes at a location from a parent node, splitting the parent if diff --git a/site/examples/forced-layout.js b/site/examples/forced-layout.js index 711c9551c..c397375c6 100644 --- a/site/examples/forced-layout.js +++ b/site/examples/forced-layout.js @@ -20,19 +20,17 @@ const withSchema = defineSchema([ const type = index === 0 ? 'title' : 'paragraph' switch (code) { - case 'child_invalid': { + case 'child_invalid': + case 'child_max_invalid': { Editor.setNodes(editor, { type }, { at: path }) break } + case 'child_min_invalid': { const block = { type, children: [{ text: '' }] } Editor.insertNodes(editor, block, { at: path }) break } - case 'child_max_invalid': { - Editor.setNodes(editor, { type }, { at: path }) - break - } } }, },