File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
test/unit/specs/directives/public Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -741,4 +741,32 @@ describe('v-model', function () {
741741 } )
742742 } )
743743 } )
744+
745+ it ( 'should not sync value on blur when parent fragment is removed' , function ( done ) {
746+ el . style . display = ''
747+ var vm = new Vue ( {
748+ el : el ,
749+ replace : false ,
750+ template :
751+ '<form v-if="ok" @submit.prevent="save">' +
752+ '<input v-model="msg">' +
753+ '</form>' ,
754+ data : {
755+ ok : true ,
756+ msg : 'hi'
757+ } ,
758+ methods : {
759+ save : function ( ) {
760+ this . ok = false
761+ this . msg = ''
762+ }
763+ }
764+ } )
765+ el . querySelector ( 'input' ) . focus ( )
766+ trigger ( el . querySelector ( 'form' ) , 'submit' )
767+ _ . nextTick ( function ( ) {
768+ expect ( vm . msg ) . toBe ( '' )
769+ done ( )
770+ } )
771+ } )
744772} )
You can’t perform that action at this time.
0 commit comments