perfectly resolve Chinese input methods issue with composition events

This commit is contained in:
Evan You 2014-01-03 12:29:19 -05:00
parent bcff84ebab
commit 1e587210d7
1 changed files with 9 additions and 0 deletions

View File

@ -27,9 +27,18 @@ module.exports = {
? 'value'
: 'innerHTML'
var compositionLock = false
el.addEventListener('compositionstart', function () {
compositionLock = true
})
el.addEventListener('compositionend', function () {
compositionLock = false
})
// attach listener
self.set = self.filters
? function () {
if (compositionLock) return
// if this directive has filters
// we need to let the vm.$set trigger
// update() so filters are applied.