Selaa lähdekoodia

Improved destroying of the ContextualBalloon.

Oskar Wróbel 8 vuotta sitten
vanhempi
sitoutus
f05ab2f00c

+ 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;
 		} );
 	} );
 } );