Răsfoiți Sursa

Hide BlockButton on init.

Oskar Wróbel 7 ani în urmă
părinte
comite
50989ee9f6

+ 3 - 0
packages/ckeditor5-ui/src/toolbar/block/view/blockbuttonview.js

@@ -30,6 +30,9 @@ export default class BlockButtonView extends ButtonView {
 
 		const bind = this.bindTemplate;
 
+		// Hide button on init.
+		this.isVisible = false;
+
 		/**
 		 * Top offset.
 		 *

+ 4 - 0
packages/ckeditor5-ui/tests/toolbar/block/view/blockbuttonview.js

@@ -13,6 +13,10 @@ describe( 'BlockButtonView', () => {
 		view.render();
 	} );
 
+	it( 'should be not visible on init', () => {
+		expect( view.isVisible ).to.false;
+	} );
+
 	it( 'should create element from template', () => {
 		expect( view.element.classList.contains( 'ck-block-toolbar-button' ) ).to.true;
 	} );