Skip to content

Commit

Permalink
perfectly resolve Chinese input methods issue with composition events
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 3, 2014
1 parent bcff84e commit 1e58721
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/directives/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 1e58721

Please sign in to comment.