Commit 06eadfd0 authored by 杨南鸿's avatar 杨南鸿

fix

parent 55fd2de6
......@@ -138,7 +138,9 @@
hovering: false,
focused: false,
isComposing: false,
passwordVisible: false
passwordVisible: false,
focusTimer: null,
focusOpen: false
};
},
......@@ -189,10 +191,6 @@
type: Boolean,
default: false
},
lazy: {
type: [Boolean, Object],
default: false
},
tabindex: String
},
......@@ -307,9 +305,6 @@
};
},
handleBlur(event) {
if (this.lazy) {
this.handleInput(event, true);
}
this.focused = false;
this.$emit('blur', event);
if (this.validateEvent) {
......@@ -361,20 +356,22 @@
this.handleInput(event);
}
},
handleInput(event, refresh) {
handleInput(event) {
// should not emit input during composition
// see: https://github.com/ElemeFE/element/issues/10516
if (this.isComposing || (this.lazy && !refresh)) return;
if (this.isComposing) return;
// hack for https://github.com/ElemeFE/element/issues/8548
// should remove the following line when we don't support IE
if (event.target.value === this.nativeInputValue) return;
this.$emit('input', event.target.value);
// ensure native input value is controlled
// see: https://github.com/ElemeFE/element/issues/12850
this.$nextTick(this.setNativeInputValue);
clearTimeout(this.focusTimer);
this.focusTimer = setTimeout(() => {
this.$emit('input', event.target.value);
// ensure native input value is controlled
// see: https://github.com/ElemeFE/element/issues/12850
this.$nextTick(this.setNativeInputValue);
}, 300);
},
handleChange(event) {
this.$emit('change', event.target.value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment