Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2197 from ibolmo/fix-2164-element-falsey-value

Fixes #2164.
  • Loading branch information...
commit d05c9fb9fdf7371ebb2429c1e2443085e653f1bd 2 parents bf35c9f + 0b42256
Christoph Pojer cpojer authored
2  Source/Element/Element.js
View
@@ -568,7 +568,7 @@ Object.append(propertySetters, {
},
'value': function(node, value){
- node.value = value || '';
+ node.value = (value != null) ? value : '';
}
});
5 Specs/1.4client/Element/Element.js
View
@@ -37,6 +37,11 @@ describe('Element', function(){
expect(new Element('input', {value: value}).get('value')).toEqual('');
});
+ it('should set a falsey value and not an empty string', function(){
+ expect(new Element('input', {value: false}).get('value')).toEqual('false');
+ expect(new Element('input', {value: 0}).get('value')).toEqual('0');
+ });
+
});
describe('type', function(){
Please sign in to comment.
Something went wrong with that request. Please try again.