File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -477,6 +477,12 @@ describe('vnode', () => {
477477 expect ( mergeProps ( { onClick : null } ) ) . toMatchObject ( {
478478 onClick : null ,
479479 } )
480+ expect (
481+ mergeProps ( { 'onUpdate:modelValue' : undefined } ) ,
482+ ) . not . toHaveProperty ( 'onUpdate:modelValue' )
483+ expect ( mergeProps ( { 'onUpdate:modelValue' : null } ) ) . not . toHaveProperty (
484+ 'onUpdate:modelValue' ,
485+ )
480486 } )
481487
482488 test ( 'default' , ( ) => {
Original file line number Diff line number Diff line change 66 extend ,
77 isArray ,
88 isFunction ,
9+ isModelListener ,
910 isObject ,
1011 isOn ,
1112 isString ,
@@ -891,7 +892,13 @@ export function mergeProps(...args: (Data & VNodeProps)[]): Data {
891892 ret [ key ] = existing
892893 ? [ ] . concat ( existing as any , incoming as any )
893894 : incoming
894- } else if ( incoming == null && existing == null ) {
895+ } else if (
896+ incoming == null &&
897+ existing == null &&
898+ // mergeProps({ 'onUpdate:modelValue': undefined }) should not retain
899+ // the model listener.
900+ ! isModelListener ( key )
901+ ) {
895902 ret [ key ] = incoming
896903 }
897904 } else if ( key !== '' ) {
You can’t perform that action at this time.
0 commit comments