Open tingjiangcao opened 2 months ago
I'm developing a note-taking software. Need to switch between different note files. And the method I have found so far is as follows:
Transforms.delete(editor, { at: { anchor: Editor.start(editor, []), focus: Editor.end(editor, []), }, }) Transforms.removeNodes(editor, {at: [0],}) Transforms.insertNodes(editor, noteObject) Transforms.select(editor, Editor.start(editor, []));
I'm wondering if there is a more simplified way that can be provided to accomplish this group. Because this is a more commonly used function.
I'm not sure if there's a method I'm not aware of
https://github.com/udecode/plate/blob/main/packages/slate-utils/src/transforms/replaceNode.ts
I'm developing a note-taking software. Need to switch between different note files. And the method I have found so far is as follows:
Transforms.delete(editor, { at: { anchor: Editor.start(editor, []), focus: Editor.end(editor, []), }, }) Transforms.removeNodes(editor, {at: [0],}) Transforms.insertNodes(editor, noteObject) Transforms.select(editor, Editor.start(editor, []));
I'm wondering if there is a more simplified way that can be provided to accomplish this group. Because this is a more commonly used function.
I'm not sure if there's a method I'm not aware of