Problem with SimpleMDE (format=markdown) in arrays
See original GitHub issueExpected behavior
My test type is an array of objects, each having a property ‘bio’ of type ‘string’ and format ‘markdown’. When creating one item in the array, the SimpleMDE textarea appears, together with the text fields for the other properties. When deleting the item just created, both the text fields and the SimpleMDE textarea should disappear.
Actual behavior
The text fields do disappear, but the SimpleMDE textarea remains. The item is not removed from the value. I get the error message “this.SimpleMDE.destroy is not a function”.
Steps to reproduce the behavior
testType = {
type: 'array',
items: {
type: 'object',
properties: {
name: { type: 'string' },
web: { type: 'string', format: 'url' },
mail: { type: 'string', format: 'email' },
bio: { type:'string', format:'markdown' }
}
}
}
// and somewhere in my html page
var editor = new JSONEditor(document.getElementById('editor_holder'),{schema:testType})
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top Results From Across the Web
Issues for SimpleMDE Markdown Editor | Drupal.org
Issues for SimpleMDE Markdown Editor ; "Warning: array_filter() expects parameter 1 to be array, null given" Warning Appears when Saving Text Format, Reviewed...
Read more >JSON Editor - npm
The default array editor takes up a lot of screen real estate. The table and tabs formats provide more compact UIs for editing...
Read more >simpleMDE set value not parsing properly - Stack Overflow
But the main issue is that the contents to set are not fixed. They are dynamically coming from the database and I'm using...
Read more >How to Create Expandable Image Effect Using HTML CSS ...
This repository is a fork of SimpleMDE, made by Sparksuite. ... previewClass: A string or array of strings that will be applied to...
Read more >Arduo Css Editor - OSCHINA - 中文开源技术交流社区
React SimpleMDE (EasyMDE) Markdown Editor React component wrapper for EasyMDE (the most fresh SimpleMDE ... Notes Issues and Pull Requests are welcome.
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
I can confirm the problem. SimpleMDE has no
destroy()
function. (Probably something leftover from when JSON-editor changed from EpicEditor to SimpleMDE)According to this PR on the SimpleMDE repo, the way to remove the editor is like this:
@jmandreoli Try modifying the
destroy
function in “src/editors/string.js” and changethis.SimpleMDE.destroy();
into the above and see if it helps.I have added the schema to the examples as “SimpleMDE”. But unfortunately the “prototype” override method doesn’t work on functions with calls to
this._super()
so it wan’t possible to test the fix using the Interactive playground.