Skip to content

Commit 27931dc

Browse files
authored
IBX-5325: Fixed error on enter to edit mode (#81)
1 parent 79f4563 commit 27931dc

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -213,14 +213,17 @@ const VIEWPORT_TOP_OFFSET = 102;
213213
}).then((editor) => {
214214
this.editor = editor;
215215
const initialData = this.getData();
216-
const updateInput = (data) => {
216+
const updateInput = (data, shouldFireInputEvent = true) => {
217217
const textarea = container.closest('.ibexa-data-source').querySelector('textarea');
218218

219219
textarea.value = this.xhtmlify(data).replace(this.xhtmlNamespace, this.ezNamespace);
220-
textarea.dispatchEvent(new Event('input'));
220+
221+
if (shouldFireInputEvent) {
222+
textarea.dispatchEvent(new Event('input'));
223+
}
221224
};
222225

223-
updateInput(initialData);
226+
updateInput(initialData, false);
224227

225228
this.editor.model.document.on('change:data', () => {
226229
const data = this.getData();

0 commit comments

Comments
 (0)