File tree Expand file tree Collapse file tree 2 files changed +15
-13
lines changed
test/unit/specs/directives/public Expand file tree Collapse file tree 2 files changed +15
-13
lines changed Original file line number Diff line number Diff line change @@ -84,19 +84,7 @@ module.exports = {
84
84
}
85
85
var attr = this . arg
86
86
if ( inputProps [ attr ] && attr in this . el ) {
87
- if ( ! this . valueRemoved ) {
88
- this . el . removeAttribute ( attr )
89
- this . valueRemoved = true
90
- }
91
87
this . el [ attr ] = value
92
- } else if ( value != null && value !== false ) {
93
- if ( xlinkRE . test ( attr ) ) {
94
- this . el . setAttributeNS ( xlinkNS , attr , value )
95
- } else {
96
- this . el . setAttribute ( attr , value )
97
- }
98
- } else {
99
- this . el . removeAttribute ( attr )
100
88
}
101
89
// set model props
102
90
var modelProp = modelProps [ attr ]
@@ -108,5 +96,20 @@ module.exports = {
108
96
model . listener ( )
109
97
}
110
98
}
99
+ // do not set value attribute for textarea
100
+ if ( attr === 'value' && this . el . tagName === 'TEXTAREA' ) {
101
+ this . el . removeAttribute ( attr )
102
+ return
103
+ }
104
+ // update attribute
105
+ if ( value != null && value !== false ) {
106
+ if ( xlinkRE . test ( attr ) ) {
107
+ this . el . setAttributeNS ( xlinkNS , attr , value )
108
+ } else {
109
+ this . el . setAttribute ( attr , value )
110
+ }
111
+ } else {
112
+ this . el . removeAttribute ( attr )
113
+ }
111
114
}
112
115
}
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ if (_.inBrowser) {
29
29
dir . el = document . createElement ( 'input' )
30
30
dir . arg = 'value'
31
31
dir . update ( 'what' )
32
- expect ( dir . el . hasAttribute ( 'value' ) ) . toBe ( false )
33
32
expect ( dir . el . value ) . toBe ( 'what' )
34
33
dir . el = document . createElement ( 'input' )
35
34
dir . el . type = 'checkbox'
You can’t perform that action at this time.
0 commit comments