Merge remote-tracking branch 'eleme/dev' into carbon

# Conflicts:
#	packages/input/src/calcTextareaHeight.js
#	packages/message-box/src/main.vue
#	packages/theme-default/src/menu.css
#	yarn.lock
This commit is contained in:
Leopoldthecoder
2017-10-20 14:08:11 +08:00
6 changed files with 45 additions and 7 deletions

View File

@@ -34,7 +34,14 @@
</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>
@@ -137,6 +144,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 () => {
@@ -304,7 +323,8 @@
editorErrorMessage: null,
callback: null,
dangerouslyUseHTMLString: false,
focusAfterClosed: null
focusAfterClosed: null,
isOnComposition: false
};
}
};