8
0
Pārlūkot izejas kodu

0 should be a falsy value as well.

Piotrek Koszuliński 9 gadi atpakaļ
vecāks
revīzija
bc81d43381

+ 1 - 2
packages/ckeditor5-ui/src/ui/view.js

@@ -489,8 +489,7 @@ export default class View {
 					value = value.reduce( binderValueReducer, '' );
 				}
 
-				const isSet = isPlainBindIf ?
-					( typeof value == 'number' || !!value ) : value;
+				const isSet = isPlainBindIf ? !!value : value;
 
 				const valueToSet = isPlainBindIf ?
 					( valueSchema[ 0 ].valueIfTrue || '' ) : value;

+ 1 - 1
packages/ckeditor5-ui/tests/ui/view.js

@@ -590,7 +590,7 @@ describe( 'View', () => {
 				expect( view.element.outerHTML ).to.be.equal( '<p>abc</p>' );
 
 				view.model.foo = 0;
-				expect( view.element.outerHTML ).to.be.equal( '<p class="foo-is-set">abc</p>' );
+				expect( view.element.outerHTML ).to.be.equal( '<p>abc</p>' );
 			} );
 		} );
 	} );