Commit f681b4bd authored by 杨奕's avatar 杨奕 Committed by GitHub

MessageBox: listen for keydown instead of keyup (#9908)

parent da2c87a0
......@@ -37,10 +37,7 @@
<el-input
v-model="inputValue"
:type="inputType"
@compositionstart.native="handleComposition"
@compositionupdate.native="handleComposition"
@compositionend.native="handleComposition"
@keyup.enter.native="handleKeyup"
@keydown.enter.native="handleAction('confirm')"
:placeholder="inputPlaceholder"
ref="input"></el-input>
<div class="el-message-box__errormsg" :style="{ visibility: !!editorErrorMessage ? 'visible' : 'hidden' }">{{ editorErrorMessage }}</div>
......@@ -145,18 +142,6 @@
},
methods: {
handleComposition(event) {
if (event.type === 'compositionend') {
setTimeout(() => {
this.isOnComposition = false;
}, 100);
} else {
this.isOnComposition = true;
}
},
handleKeyup() {
!this.isOnComposition && this.handleAction('confirm');
},
getSafeClose() {
const currentId = this.uid;
return () => {
......
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