easy-markdown-editor icon indicating copy to clipboard operation
easy-markdown-editor copied to clipboard

[Feature Request] Add the ability to destruct the editor

Open hsalem7 opened this issue 4 years ago • 5 comments

If there is a place where we are conditionally showing the editor, then it is better to have a destruct method.

var simplemde = new SimpleMDE({ element: document.getElementById("MyID") });

And when there is a need to hide/remove the editor:

simplemde.destruct();

It should remove all the elements that were added because of the construct method.

hsalem7 avatar Jul 03 '21 14:07 hsalem7

I found that this function already exists, and it is called toTextArea()!. What do you think if we rename it? Or add a clearer description?

hsalem7 avatar Jul 03 '21 14:07 hsalem7

Renaming the toTextArea() function is not possible in any 2.x.x version because it would break backwards compatibility. Maybe an alias is acceptable?

Ionaru avatar Jul 07 '21 23:07 Ionaru

Renaming the toTextArea() function is not possible in any 2.x.x version because it would break backwards compatibility. Maybe an alias is acceptable?

Yeah that would be great, or to add a comment block to describe how toTextarea can be used, thankss

hsalem7 avatar Jul 20 '21 09:07 hsalem7

It is mentioned in the readme. https://github.com/Ionaru/easy-markdown-editor#removing-easymde-from-text-area

Ionaru avatar Jul 20 '21 10:07 Ionaru

Close the issue if it is resolved.

vanillajonathan avatar May 17 '22 20:05 vanillajonathan