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 a470efb7..1780ddf8 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 @@ -87,6 +87,13 @@ class IbexaCustomTagUI extends Plugin { this.attributesView.setChildren({ attributes: this.config.attributes, }); + + clickOutsideHandler({ + emitter: this.attributesView, + activator: () => this.balloon.hasView(this.attributesView), + contextElements: [this.balloon.view.element], + callback: () => this.hideAttributes(), + }); } createFormView() { @@ -132,7 +139,7 @@ class IbexaCustomTagUI extends Plugin { this.balloon.add({ view: this.attributesView, - position: this.getBalloonPositionData(), + position: { target }, }); this.balloon.updatePosition({ target }); diff --git a/src/bundle/Resources/public/js/CKEditor/custom-tags/ui/custom-tag-attributes-view.js b/src/bundle/Resources/public/js/CKEditor/custom-tags/ui/custom-tag-attributes-view.js index f6497f21..fd17f59e 100644 --- a/src/bundle/Resources/public/js/CKEditor/custom-tags/ui/custom-tag-attributes-view.js +++ b/src/bundle/Resources/public/js/CKEditor/custom-tags/ui/custom-tag-attributes-view.js @@ -1,7 +1,7 @@ import View from '@ckeditor/ckeditor5-ui/src/view'; import IbexaButtonView from '../../common/button-view/button-view'; -class IbexaCustomTagFormView extends View { +class IbexaCustomTagAttributesView extends View { constructor(props) { super(props); @@ -89,4 +89,4 @@ class IbexaCustomTagFormView extends View { } } -export default IbexaCustomTagFormView; +export default IbexaCustomTagAttributesView;