fix: unnecessary input event on input tag placeholder in IE #92
							parent
							
								
									4021693893
								
							
						
					
					
						commit
						95c9d6403f
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			@ -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 {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue