fix: Microsoft input triggers onchange twice (#3825)
parent
cdde89b17e
commit
e0967d9d7e
|
@ -264,6 +264,10 @@ export default {
|
||||||
|
|
||||||
this.$emit('keyup', e, ...args);
|
this.$emit('keyup', e, ...args);
|
||||||
},
|
},
|
||||||
|
onTrigger(e) {
|
||||||
|
if (e.target.composing) return false;
|
||||||
|
this.onChange(e);
|
||||||
|
},
|
||||||
onChange(e) {
|
onChange(e) {
|
||||||
if (this.focused) {
|
if (this.focused) {
|
||||||
this.inputting = true;
|
this.inputting = true;
|
||||||
|
@ -621,6 +625,13 @@ export default {
|
||||||
handleInputClick() {
|
handleInputClick() {
|
||||||
this.$emit('click');
|
this.$emit('click');
|
||||||
},
|
},
|
||||||
|
onCompositionstart(e) {
|
||||||
|
e.target.composing = true;
|
||||||
|
},
|
||||||
|
onCompositionend(e) {
|
||||||
|
this.onChange(e);
|
||||||
|
e.target.composing = false;
|
||||||
|
},
|
||||||
},
|
},
|
||||||
render() {
|
render() {
|
||||||
const {
|
const {
|
||||||
|
@ -775,7 +786,9 @@ export default {
|
||||||
name={this.name}
|
name={this.name}
|
||||||
title={this.title}
|
title={this.title}
|
||||||
id={this.id}
|
id={this.id}
|
||||||
onInput={this.onChange}
|
onInput={this.onTrigger}
|
||||||
|
onCompositionstart={this.onCompositionstart}
|
||||||
|
onCompositionend={this.onCompositionend}
|
||||||
ref="inputRef"
|
ref="inputRef"
|
||||||
value={inputDisplayValue}
|
value={inputDisplayValue}
|
||||||
pattern={this.pattern}
|
pattern={this.pattern}
|
||||||
|
|
Loading…
Reference in New Issue