Unable to overrde editor.insertNode and editor.insertFragment
See original GitHub issueDo you want to request a feature or report a bug?
Bug
What’s the current behavior?
Unable to override editor.insertNode and editor.insertFragment
const MyEditor = (editor) => {
...
editor.insertNode = node => {
insertNode(node)
console.log(node)
}
...
return editor
}
Slate: 0.57.1 Browser: Chrome OS: Mac
What’s the expected behavior?
Should be able to extend these two method with custom logic.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:11 (5 by maintainers)
Top Results From Across the Web
Editor - Slate
The Editor object stores all the state of a Slate editor. It can be extended by plugins to add helpers and implement new...
Read more >Slate.js throws an error when inserting a new node at selected ...
The issue is related to rendering when you use useMemo , instead you should use useRef : const editorRef = useRef() if (!editorRef.current) ......
Read more >AuthorDocumentFilter (Oxygen XML API)
AuthorDocumentFilter , is a filter for the methods which modify the AuthorDocument . When the AuthorDocument is modified through the methods from the ......
Read more >Slate js Tip - Deep clone nodes recursively - jkrsp.com
insertNodes for example). ... editor.fragment() returns the list of nodes associated with the ... editor.insertFragment(cloneChildren(frag)).
Read more >tinymce.dev - Waldmonitoring Wiki
insertBefore (element.dom(), marker.dom()); }); }; var after = function (marker, ... setInterval: wrappedSetInterval, setEditorTimeout: function (editor, ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
folks, you can already override insertNode and insertData.
Hi @mresposito , I missed your reply. Thank you very much for providing the example.
However, I tried the same code, insertData works, but NOT insertNode.
As @Entkenntnis observed, slate does not seems to be calling editor.insertNode at all, which I think is a bug.
Q.