diff --git a/components/_util/env.js b/components/_util/env.js new file mode 100644 index 0000000000..64365dbced --- /dev/null +++ b/components/_util/env.js @@ -0,0 +1,4 @@ +export const inBrowser = typeof window !== 'undefined' +export const UA = inBrowser && window.navigator.userAgent.toLowerCase() +export const isIE = UA && /msie|trident/.test(UA) +export const isIE9 = UA && UA.indexOf('msie 9.0') > 0 diff --git a/components/input/Input.jsx b/components/input/Input.jsx index dd7fa76a3c..c1c7c98619 100644 --- a/components/input/Input.jsx +++ b/components/input/Input.jsx @@ -3,6 +3,7 @@ import TextArea from './TextArea' import omit from 'omit.js' import inputProps from './inputProps' import { hasProp, getComponentFromProp, getStyle, getClass } from '../_util/props-util' +import { isIE, isIE9 } from '../_util/env' function fixControlledValue (value) { if (typeof value === 'undefined' || value === null) { @@ -47,6 +48,10 @@ export default { this.$emit('keydown', e) }, handleChange (e) { + // https://github.com/vueComponent/ant-design-vue/issues/92 + if (isIE && !isIE9 && this.stateValue === e.target.value) { + return + } if (!hasProp(this, 'value')) { this.stateValue = e.target.value } else {