File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
test/unit/specs/directives Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ module.exports = {
3535 } ,
3636
3737 setAttr : function ( attr , value ) {
38- if ( value || value === 0 ) {
38+ if ( value != null && value !== false ) {
3939 if ( xlinkRE . test ( attr ) ) {
4040 this . el . setAttributeNS ( xlinkNS , attr , value )
4141 } else {
@@ -44,9 +44,8 @@ module.exports = {
4444 } else {
4545 this . el . removeAttribute ( attr )
4646 }
47- if ( attr in this . el ) {
48- this . el [ attr ] = value
47+ if ( attr === 'value' && 'value' in this . el ) {
48+ this . el . value = value
4949 }
5050 }
51-
5251}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ if (_.inBrowser) {
2626 expect ( el . getAttribute ( 'test' ) ) . toBe ( '0' )
2727 } )
2828
29- it ( 'should set property' , function ( ) {
29+ it ( 'should set property for input value ' , function ( ) {
3030 dir . el = document . createElement ( 'input' )
3131 dir . arg = 'value'
3232 dir . update ( 'what' )
You can’t perform that action at this time.
0 commit comments