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 = {
35
35
} ,
36
36
37
37
setAttr : function ( attr , value ) {
38
- if ( value || value === 0 ) {
38
+ if ( value != null && value !== false ) {
39
39
if ( xlinkRE . test ( attr ) ) {
40
40
this . el . setAttributeNS ( xlinkNS , attr , value )
41
41
} else {
@@ -44,9 +44,8 @@ module.exports = {
44
44
} else {
45
45
this . el . removeAttribute ( attr )
46
46
}
47
- if ( attr in this . el ) {
48
- this . el [ attr ] = value
47
+ if ( attr === 'value' && 'value' in this . el ) {
48
+ this . el . value = value
49
49
}
50
50
}
51
-
52
51
}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ if (_.inBrowser) {
26
26
expect ( el . getAttribute ( 'test' ) ) . toBe ( '0' )
27
27
} )
28
28
29
- it ( 'should set property' , function ( ) {
29
+ it ( 'should set property for input value ' , function ( ) {
30
30
dir . el = document . createElement ( 'input' )
31
31
dir . arg = 'value'
32
32
dir . update ( 'what' )
You can’t perform that action at this time.
0 commit comments