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

fix

parent 55fd2de6
...@@ -138,7 +138,9 @@ ...@@ -138,7 +138,9 @@
hovering: false, hovering: false,
focused: false, focused: false,
isComposing: false, isComposing: false,
passwordVisible: false passwordVisible: false,
focusTimer: null,
focusOpen: false
}; };
}, },
...@@ -189,10 +191,6 @@ ...@@ -189,10 +191,6 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
lazy: {
type: [Boolean, Object],
default: false
},
tabindex: String tabindex: String
}, },
...@@ -307,9 +305,6 @@ ...@@ -307,9 +305,6 @@
}; };
}, },
handleBlur(event) { handleBlur(event) {
if (this.lazy) {
this.handleInput(event, true);
}
this.focused = false; this.focused = false;
this.$emit('blur', event); this.$emit('blur', event);
if (this.validateEvent) { if (this.validateEvent) {
...@@ -361,20 +356,22 @@ ...@@ -361,20 +356,22 @@
this.handleInput(event); this.handleInput(event);
} }
}, },
handleInput(event, refresh) { handleInput(event) {
// should not emit input during composition // should not emit input during composition
// see: https://github.com/ElemeFE/element/issues/10516 // 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 // hack for https://github.com/ElemeFE/element/issues/8548
// should remove the following line when we don't support IE // should remove the following line when we don't support IE
if (event.target.value === this.nativeInputValue) return; if (event.target.value === this.nativeInputValue) return;
clearTimeout(this.focusTimer);
this.focusTimer = setTimeout(() => {
this.$emit('input', event.target.value); this.$emit('input', event.target.value);
// ensure native input value is controlled // ensure native input value is controlled
// see: https://github.com/ElemeFE/element/issues/12850 // see: https://github.com/ElemeFE/element/issues/12850
this.$nextTick(this.setNativeInputValue); this.$nextTick(this.setNativeInputValue);
}, 300);
}, },
handleChange(event) { handleChange(event) {
this.$emit('change', event.target.value); 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