Skip to content
Snippets Groups Projects
Commit b74f2890 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

only trigger if the editor is still attached to the textarea, fixes #3440

Closes #3440

Merge request studip/studip!2338
parent 34b0fa80
No related branches found
No related tags found
No related merge requests found
......@@ -213,8 +213,11 @@ function enhanceEditor($textarea, ckeditor) {
// make sure HTML marker is always set, in
// case contents are cut-off by the backend
$textarea.closest('form').submit(() => {
ckeditor.setData(wysiwyg.markAsHtml(ckeditor.getData()));
ckeditor.updateSourceElement();
// only trigger if the editor is still attached to the textarea
if (getEditor($textarea[0]) === ckeditor) {
ckeditor.setData(wysiwyg.markAsHtml(ckeditor.getData()));
ckeditor.updateSourceElement();
}
});
// focus the editor if requested
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment