diff --git a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js index 61cb9a74..1245b46b 100644 --- a/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js +++ b/src/bundle/Resources/public/js/CKEditor/core/base-ckeditor.js @@ -305,8 +305,17 @@ const VIEWPORT_TOP_OFFSET_DISTRACTION_FREE_MODE = 0; updateInput(initialData, false); - this.editor.model.document.on('change:data', () => { + this.editor.model.document.on('change:data', (eventInfo) => { const data = this.getData(); + const changes = Array.from(eventInfo.source.differ.getChanges()); + const shouldFireInputEventAttribute = changes.find( + (change) => change.type === 'attribute' && change.attributeKey === 'shouldFireInputEvent', + ); + if (shouldFireInputEventAttribute && typeof shouldFireInputEventAttribute.attributeNewValue === 'boolean') { + updateInput(data, shouldFireInputEventAttribute.attributeNewValue); + + return; + } updateInput(data); }); diff --git a/src/bundle/Resources/public/js/CKEditor/embed/content-inline/embed-inline-editing.js b/src/bundle/Resources/public/js/CKEditor/embed/content-inline/embed-inline-editing.js index 729ec1b5..4e9c4ff6 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/content-inline/embed-inline-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/content-inline/embed-inline-editing.js @@ -165,6 +165,7 @@ class IbexaEmbedContentInlineEditing extends Plugin { writer.setAttribute('contentId', contentId, modelElement); writer.setAttribute('locationId', locationId, modelElement); writer.setAttribute('languageCodes', languageCodes, modelElement); + writer.setAttribute('shouldFireInputEvent', false, modelElement); }); }); diff --git a/src/bundle/Resources/public/js/CKEditor/embed/content/embed-editing.js b/src/bundle/Resources/public/js/CKEditor/embed/content/embed-editing.js index fb1b240d..20e2b128 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/content/embed-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/content/embed-editing.js @@ -167,6 +167,7 @@ class IbexaEmbedContentEditing extends Plugin { writer.setAttribute('contentId', contentId, modelElement); writer.setAttribute('locationId', locationId, modelElement); writer.setAttribute('languageCodes', languageCodes, modelElement); + writer.setAttribute('shouldFireInputEvent', false, modelElement); }); }); diff --git a/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js b/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js index 4cf63849..79eebb80 100644 --- a/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js +++ b/src/bundle/Resources/public/js/CKEditor/embed/image/embed-image-editing.js @@ -58,6 +58,7 @@ class IbexaEmbedImageEditing extends Plugin { .then((imageData) => { this.editor.model.change((writer) => { writer.setAttribute('previewUrl', imageData.ContentImageVariation.uri, modelElement); + writer.setAttribute('shouldFireInputEvent', false, modelElement); }); }) .catch(window.ibexa.helpers.notification.showErrorNotification);