8
0
فهرست منبع

Improved destroying of the ContextualBalloon.

Oskar Wróbel 8 سال پیش
والد
کامیت
f05ab2f00c
2فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 1 0
      packages/ckeditor5-ui/src/contextualballoon.js
  2. 2 1
      packages/ckeditor5-ui/tests/contextualballoon.js

+ 1 - 0
packages/ckeditor5-ui/src/contextualballoon.js

@@ -196,6 +196,7 @@ export default class ContextualBalloon extends Plugin {
 	destroy() {
 		this.editor.ui.view.body.remove( this.view );
 		this.view.destroy();
+		this._stack.clear();
 		super.destroy();
 	}
 }

+ 2 - 1
packages/ckeditor5-ui/tests/contextualballoon.js

@@ -289,10 +289,11 @@ describe( 'ContextualBalloon', () => {
 	} );
 
 	describe( 'destroy()', () => {
-		it( 'should balloon panel remove view from editor body collection', () => {
+		it( 'should remove balloon panel view from editor body collection and clear stack', () => {
 			balloon.destroy();
 
 			expect( editor.ui.view.body.getIndex( balloon.view ) ).to.equal( -1 );
+			expect( balloon.visibleView ).to.null;
 		} );
 	} );
 } );