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

pull/8601/merge
杨奕 2018-02-27 16:22:20 +08:00 committed by GitHub
parent da2c87a03d
commit f681b4bded
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 16 deletions

View File

@ -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 () => {