@ckeditor/ckeditor5-ui 47.4.0 → 47.5.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -16796,8 +16796,7 @@ const toPx$2 = /* #__PURE__ */ toUnit('px');
16796
16796
  const selection = editor.model.document.selection;
16797
16797
  // Show/hide the toolbar on editable focus/blur.
16798
16798
  this.listenTo(this.focusTracker, 'change:isFocused', (evt, name, isFocused)=>{
16799
- const isToolbarVisible = this._balloon.visibleView === this.toolbarView;
16800
- if (!isFocused && isToolbarVisible) {
16799
+ if (!isFocused && this._isToolbarVisible) {
16801
16800
  this.hide();
16802
16801
  } else if (isFocused) {
16803
16802
  this.show();
@@ -16844,6 +16843,11 @@ const toPx$2 = /* #__PURE__ */ toUnit('px');
16844
16843
  this.toolbarView.fillFromConfig(this._balloonConfig, this.editor.ui.componentFactory);
16845
16844
  });
16846
16845
  }
16846
+ /**
16847
+ * Returns whether the toolbar is visible in the ContextualBalloon.
16848
+ */ get _isToolbarVisible() {
16849
+ return this._balloon.visibleView === this.toolbarView;
16850
+ }
16847
16851
  /**
16848
16852
  * Creates the toolbar view instance.
16849
16853
  */ _createToolbarView() {
@@ -16964,7 +16968,9 @@ const toPx$2 = /* #__PURE__ */ toUnit('px');
16964
16968
  * * in the geometry of the selection it is attached to (e.g. the selection moved in the viewport or expanded or shrunk),
16965
16969
  * * or the geometry of the balloon toolbar itself (e.g. the toolbar has grouped or ungrouped some items and it is shorter or longer).
16966
16970
  */ _updatePosition() {
16967
- this._balloon.updatePosition(this._getBalloonPositionData());
16971
+ if (this._isToolbarVisible) {
16972
+ this._balloon.updatePosition(this._getBalloonPositionData());
16973
+ }
16968
16974
  }
16969
16975
  /**
16970
16976
  * @inheritDoc