Browse Source

!184 fix: 表情位置异常的bug
Merge pull request !184 from blue/v_3.0.0

blue 2 tháng trước cách đây
mục cha
commit
31123a8aea
1 tập tin đã thay đổi với 13 bổ sung13 xóa
  1. 13 13
      im-web/src/components/chat/ChatInput.vue

+ 13 - 13
im-web/src/components/chat/ChatInput.vue

@@ -1,9 +1,9 @@
 <template>
 	<div class="chat-input-area">
-		<div :class="['edit-chat-container', isEmpty ? '' : 'not-empty']" contenteditable="true"
-			@paste.prevent="onPaste" @keydown="onKeydown" @compositionstart="compositionFlag = true"
-			@compositionend="onCompositionEnd" @input="onEditorInput" @mousedown="onMousedown" ref="content"
-			@blur="onBlur">
+		<div :class="['edit-container', isEmpty ? '' : 'not-empty']" contenteditable="true" @paste.prevent="onPaste"
+			@keydown="onKeydown" @compositionstart="compositionFlag = true" @compositionend="onCompositionEnd"
+			@input="onEditorInput" @mousedown="onMousedown" ref="content" @keyup="onKeyup" @click="onClickInput">
+
 		</div>
 		<chat-at-box @select="onAtSelect" :search-text="atSearchText" ref="atBox" :ownerId="ownerId"
 			:members="groupMembers"></chat-at-box>
@@ -232,12 +232,12 @@ export default {
 					this.showAtBox(e)
 				}
 			}
-
 		},
-		onBlur(e) {
-			if (!this.atIng) {
-				//this.updateRange();
-			}
+		onClickInput() {
+			this.updateRange();
+		},
+		onKeyup() {
+			this.updateRange();
 		},
 		onMousedown() {
 			if (this.atIng) {
@@ -462,7 +462,7 @@ export default {
 	height: 100%;
 	position: relative;
 
-	.edit-chat-container {
+	.edit-container {
 		position: absolute;
 		top: 0;
 		left: 0;
@@ -536,14 +536,14 @@ export default {
 		}
 	}
 
-	.edit-chat-container>div:nth-of-type(1):after {
+	.edit-container>div:nth-of-type(1):after {
 		content: '请输入消息(按Ctrl+Enter键换行)';
 		color: gray;
 	}
 
-	.edit-chat-container.not-empty>div:nth-of-type(1):after {
+	.edit-container.not-empty>div:nth-of-type(1):after {
 		content: none;
 	}
 
 }
-</style>
+</style>