Destroying editor NodeViews

@marijn I am using the codemirror example and wondering if it could be removed by clicking an icon on the editor. Is it possible to destroy/detach NodeViews programmatically from main editor?

What does ‘destroy’ mean here? Delete the node?

Yes, how to remove the codemirror editor node from main EditorView? :slight_smile:

In footnote example this seems trivial because it’s using EditorView inside MainView so, calling destroy() works but don’t think it’s same with codemirror node right?

You can delete a node the usual way, with, for example, Transform.delete. As long as a node is in the document, its node view remains active.

Thanks @marijn for quick reply :slight_smile: I have been trying to do that but seems like I am doing something wrong. It clears the whole editor when using tr.delete(). Probably I am using wrong position.

Finally, got it working :thumbsup: Thanks for your help :pray: