django-editorjs-fields
django-editorjs-fields copied to clipboard
The editor.js is not initiated when used inside of inlines
This problem occurs in Django administration and in frontend forms with dynamically addable inlines.
Ideally there could be a custom event to trigger that would reinitiate all widgets that haven't been initiated. Probably where you can pass the container element where to look for the textareas.
Also there should be multiple textareas allowed with the dynamically added formsets.
If the admin inline has more than one Editor.js fields, only the first one gets initiated, and others are ignored and show textareas with the value "null".
You can see the problem from this line of code, when only the 0th textarea is initiated.
For inlines in the frontend, there is no way to trigger re-initiation, because the initation function initEditorJsField() is within a JavaScript closure – so no access to it at all.