diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-ui.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-ui.js index 26f24099..86d8bbfa 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-ui.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/block-custom-tag/custom-tag-ui.js @@ -19,6 +19,22 @@ class IbexaCustomTagUI extends Plugin { this.addCustomTag = this.addCustomTag.bind(this); this.isNew = false; + this.lastClassListValue = null; + this.observer = new MutationObserver((mutationList) => { + for (const mutation of mutationList) { + if (this.lastClassListValue !== mutation.target.classList.value) { + if (this.lastClassListValue !== null) { + setPanelContentMaxHeight(this.balloon.view); + } + + this.lastClassListValue = mutation.target.classList.value; + } + } + }); + + this.observer.observe(this.balloon.view.element, { + attributes: true, + }); } isCustomTagSelected(eventData) {