Skip to content

Commit

Permalink
IBX-5325: Fixed error on enter to edit mode (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
dew326 committed Apr 12, 2023
1 parent 79f4563 commit 27931dc
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -213,14 +213,17 @@ const VIEWPORT_TOP_OFFSET = 102;
}).then((editor) => {
this.editor = editor;
const initialData = this.getData();
const updateInput = (data) => {
const updateInput = (data, shouldFireInputEvent = true) => {
const textarea = container.closest('.ibexa-data-source').querySelector('textarea');

textarea.value = this.xhtmlify(data).replace(this.xhtmlNamespace, this.ezNamespace);
textarea.dispatchEvent(new Event('input'));

if (shouldFireInputEvent) {
textarea.dispatchEvent(new Event('input'));
}
};

updateInput(initialData);
updateInput(initialData, false);

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

0 comments on commit 27931dc

Please sign in to comment.