mirror of https://github.com/ElemeFE/element
MessageBox: listen for keydown instead of keyup (#9908)
parent
da2c87a03d
commit
f681b4bded
|
@ -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 () => {
|
||||
|
|
Loading…
Reference in New Issue