Skip to content

Commit

Permalink
fix(v-model): use consistent behavior during IME composition for othe…
Browse files Browse the repository at this point in the history
…r text-like input types (fix #5902)
  • Loading branch information
yyx990803 committed Jun 17, 2017
1 parent 4f8f4db commit 4acc8c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/platforms/web/runtime/directives/model.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
* properties to Elements.
*/

import { looseEqual, looseIndexOf } from 'shared/util'
import { looseEqual, looseIndexOf, makeMap } from 'shared/util'
import { warn, isAndroid, isIE9, isIE, isEdge } from 'core/util/index'

const isTextInputType = makeMap('text,password,search,email,tel,url')

/* istanbul ignore if */
if (isIE9) {
// http://www.matts411.com/post/internet-explorer-9-oninput/
Expand All @@ -28,7 +30,7 @@ export default {
if (isIE || isEdge) {
setTimeout(cb, 0)
}
} else if (vnode.tag === 'textarea' || el.type === 'text' || el.type === 'password') {
} else if (vnode.tag === 'textarea' || isTextInputType(el.type)) {
el._vModifiers = binding.modifiers
if (!binding.modifiers.lazy) {
// Safari < 10.2 & UIWebView doesn't fire compositionend when
Expand Down

0 comments on commit 4acc8c8

Please sign in to comment.