Skip to content

Commit 98326ce

Browse files
committed
add extra change listener for v-model (fix vuejs#5248, vuejs#5387)
1 parent b997af0 commit 98326ce

File tree

1 file changed

+5
-0
lines changed
  • src/platforms/web/runtime/directives

1 file changed

+5
-0
lines changed

src/platforms/web/runtime/directives/model.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export default {
3131
} else if (vnode.tag === 'textarea' || el.type === 'text' || el.type === 'password') {
3232
el._vModifiers = binding.modifiers
3333
if (!binding.modifiers.lazy) {
34+
// Safari < 10.2 & UIWebView doesn't fire compositionend when
35+
// siwtching focus before confirming composition choice
36+
// this also fixes the issue where some browsers e.g. iOS Chrome
37+
// fires "change" instead of "input" on autocomplete.
38+
el.addEventListener('change', onCompositionEnd)
3439
if (!isAndroid) {
3540
el.addEventListener('compositionstart', onCompositionStart)
3641
el.addEventListener('compositionend', onCompositionEnd)

0 commit comments

Comments
 (0)