Skip to content

Commit

Permalink
add extra change listener for v-model (fix #5248, #5387)
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Apr 10, 2017
1 parent b997af0 commit 98326ce
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/platforms/web/runtime/directives/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export default {
} else if (vnode.tag === 'textarea' || el.type === 'text' || el.type === 'password') {
el._vModifiers = binding.modifiers
if (!binding.modifiers.lazy) {
// Safari < 10.2 & UIWebView doesn't fire compositionend when
// siwtching focus before confirming composition choice
// this also fixes the issue where some browsers e.g. iOS Chrome
// fires "change" instead of "input" on autocomplete.
el.addEventListener('change', onCompositionEnd)
if (!isAndroid) {
el.addEventListener('compositionstart', onCompositionStart)
el.addEventListener('compositionend', onCompositionEnd)
Expand Down

0 comments on commit 98326ce

Please sign in to comment.