瀏覽代碼

Reposition visible toolbar when it is in a not visible stack of rotator.

The previous fix was causing problems in some edge cases - ie when toolbar was removed on focus lost and the whole logic was re-applied twice instead of just repositioning the toolbar. See https://github.com/ckeditor/ckeditor5/issues/1957.
Maciej Gołaszewski 6 年之前
父節點
當前提交
8b53301125
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      packages/ckeditor5-widget/src/widgettoolbarrepository.js

+ 2 - 1
packages/ckeditor5-widget/src/widgettoolbarrepository.js

@@ -222,7 +222,8 @@ export default class WidgetToolbarRepository extends Plugin {
 			this.listenTo( this._balloon, 'change:visibleView', () => {
 				for ( const definition of this._toolbarDefinitions.values() ) {
 					if ( this._isToolbarVisible( definition ) ) {
-						this._updateToolbarsVisibility( definition );
+						const relatedElement = definition.getRelatedElement( this.editor.editing.view.document.selection );
+						repositionContextualBalloon( this.editor, relatedElement );
 					}
 				}
 			} );