Using multiple textfields or the paragraphs module the editor keeps duplicating on each ajax request.
Also changes can only be made to the last of the fields. When you save the node the changes disappear from the previous fields.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | support_multiple_fields-2820398-7.patch | 1020 bytes | kopin |
| #2 | support_multiple_fields-2820398-2.patch | 1.22 KB | kopin |
Comments
Comment #2
kopin commentedI am adding a patch that supports multiple fields. This will also work with the paragraphs module.
I am checking if the editor is already attached before calling the method and added forceSync method to the simpleMDE.
I also attached jQuery into the editor.behaviour
Comment #3
ademarco commentedThank you so much for the patch Kopin!
I would like to keep the module not dependent from jQuery as much as possible, could we perform class checking using simple vanilla JS?
We should namespace this class in order to avoid conflicts, shall we try something like "simplemce-processed"?
jQuery should be added as a library dependency too but, as said above, I'd rather not use it unless really necessary.
Comment #4
ademarco commentedComment #5
kopin commentedSure we can do that. I'm just thinking since jQuery is a dependency for Drupal why not make use of it?
CKEditor does for ex. It's not like we are loading en extra library, it's already there.
What do you think?
Comment #6
ademarco commentedIn Drupal 8 jQuery is not loaded by default like in Drupal 7, so I think we should remove it.
Comment #7
kopin commentedAdding new patch without jQuery and with better Classname as you requested :)
Comment #8
kopin commentedComment #10
ademarco commented