Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit afc15aa

Browse filesBrowse files
committed
test case for 0efdd80
1 parent 0efdd80 commit afc15aa
Copy full SHA for afc15aa

File tree

Expand file treeCollapse file tree

1 file changed

+28
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+28
-0
lines changed

‎test/unit/specs/directives/public/model_spec.js

Copy file name to clipboardExpand all lines: test/unit/specs/directives/public/model_spec.js
+28Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff 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
})

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.