File tree 2 files changed +15
-0
lines changed 2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -79,6 +79,7 @@ export function compatCoerceAttr(
79
79
}
80
80
} else if (
81
81
value === false &&
82
+ ! ( el . tagName === 'INPUT' && key === 'value' ) &&
82
83
! isSpecialBooleanAttr ( key ) &&
83
84
compatUtils . isCompatEnabled ( DeprecationTypes . ATTR_FALSE_VALUE , instance )
84
85
) {
Original file line number Diff line number Diff line change @@ -208,6 +208,20 @@ test('ATTR_FALSE_VALUE', () => {
208
208
) . toHaveBeenWarned ( )
209
209
} )
210
210
211
+ test ( 'ATTR_FALSE_VALUE with false on input value' , ( ) => {
212
+ const vm = new Vue ( {
213
+ template : `<input :value="false"/>` ,
214
+ } ) . $mount ( )
215
+ expect ( vm . $el ) . toBeInstanceOf ( HTMLInputElement )
216
+ expect ( vm . $el . hasAttribute ( 'value' ) ) . toBe ( true )
217
+ expect ( vm . $el . getAttribute ( 'value' ) ) . toBe ( 'false' )
218
+ expect (
219
+ ( deprecationData [ DeprecationTypes . ATTR_FALSE_VALUE ] . message as Function ) (
220
+ 'value' ,
221
+ ) ,
222
+ ) . not . toHaveBeenWarned ( )
223
+ } )
224
+
211
225
test ( "ATTR_FALSE_VALUE with false value shouldn't throw warning" , ( ) => {
212
226
const vm = new Vue ( {
213
227
template : `<div :id="false" :foo="false"/>` ,
You can’t perform that action at this time.
0 commit comments