mirror of
https://github.com/ElemeFE/element.git
synced 2025-12-19 12:04:02 +08:00
minor fixes for select, message-box and textarea
This commit is contained in:
committed by
Black Wayne
parent
78218ab940
commit
2999279ae3
@@ -15,7 +15,14 @@
|
||||
<slot><p>{{ message }}</p></slot>
|
||||
</div>
|
||||
<div class="el-message-box__input" v-show="showInput">
|
||||
<el-input v-model="inputValue" @keyup.enter.native="handleAction('confirm')" :placeholder="inputPlaceholder" ref="input"></el-input>
|
||||
<el-input
|
||||
v-model="inputValue"
|
||||
@compositionstart.native="handleComposition"
|
||||
@compositionupdate.native="handleComposition"
|
||||
@compositionend.native="handleComposition"
|
||||
@keyup.enter.native="handleKeyup"
|
||||
:placeholder="inputPlaceholder"
|
||||
ref="input"></el-input>
|
||||
<div class="el-message-box__errormsg" :style="{ visibility: !!editorErrorMessage ? 'visible' : 'hidden' }">{{ editorErrorMessage }}</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -97,6 +104,18 @@
|
||||
},
|
||||
|
||||
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 () => {
|
||||
@@ -234,7 +253,8 @@
|
||||
confirmButtonDisabled: false,
|
||||
cancelButtonClass: '',
|
||||
editorErrorMessage: null,
|
||||
callback: null
|
||||
callback: null,
|
||||
isOnComposition: false
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user