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 = {
8484 }
8585 var attr = this . arg
8686 if ( inputProps [ attr ] && attr in this . el ) {
87- if ( ! this . valueRemoved ) {
88- this . el . removeAttribute ( attr )
89- this . valueRemoved = true
90- }
9187 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 )
10088 }
10189 // set model props
10290 var modelProp = modelProps [ attr ]
@@ -108,5 +96,20 @@ module.exports = {
10896 model . listener ( )
10997 }
11098 }
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+ }
111114 }
112115}
Original file line number Diff line number Diff line change @@ -29,7 +29,6 @@ if (_.inBrowser) {
2929 dir . el = document . createElement ( 'input' )
3030 dir . arg = 'value'
3131 dir . update ( 'what' )
32- expect ( dir . el . hasAttribute ( 'value' ) ) . toBe ( false )
3332 expect ( dir . el . value ) . toBe ( 'what' )
3433 dir . el = document . createElement ( 'input' )
3534 dir . el . type = 'checkbox'
You can’t perform that action at this time.
0 commit comments