diff --git a/package.json b/package.json index 54da29ea0..16864f57c 100644 --- a/package.json +++ b/package.json @@ -72,7 +72,7 @@ "vue-resize-observer": "^2.0.16", "vue-router": "^3.6.5", "vue-template-compiler": "~2.6.14", - "vue-virtual-scroll-list-hi": "^2.3.5-15", + "vue-virtual-scroll-list-hi": "^2.3.5-16", "vuedraggable": "^2.24.3", "vuex": "^3.6.2" }, diff --git a/resources/assets/js/pages/manage/components/ChatInput/index.vue b/resources/assets/js/pages/manage/components/ChatInput/index.vue index ea6178708..d7aafbb84 100755 --- a/resources/assets/js/pages/manage/components/ChatInput/index.vue +++ b/resources/assets/js/pages/manage/components/ChatInput/index.vue @@ -1180,6 +1180,10 @@ export default { }, 100) }, + getEditor() { + return this.fullInput ? this.fullQuill : this.quill + }, + getText() { if (this.quill) { return `${this.quill.getText()}`.replace(/^\s+|\s+$/g, "") @@ -1230,16 +1234,17 @@ export default { focus() { this.$nextTick(() => { - if (this.quill) { - this.quill.setSelection(this.quill.getLength()) - this.quill.focus() + const quill = this.getEditor(); + if (quill) { + quill.setSelection(quill.getLength()) + quill.focus() } }) }, blur() { this.$nextTick(() => { - this.quill && this.quill.blur() + this.getEditor()?.blur() }) }, diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue index ae29d1672..75ccba9a3 100644 --- a/resources/assets/js/pages/manage/components/DialogWrapper.vue +++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue @@ -206,7 +206,7 @@ @scroll="onScroll" @totop="onPrevPage" @range="onRange" - @active-range="onActiveRange" + @visible="onVisible" @on-mention="onMention" @on-longpress="onLongpress" @@ -1556,7 +1556,9 @@ export default { setTimeout(_ => { this.onSearchMsgId() this.positionShow = this.readTimeout === null - this.startMsgId === 0 && (this.startMsgId = data.list[data.list.length - 1]?.id || 0) + if (this.startMsgId === 0 && data.list.length > 0) { + this.startMsgId = data.list[data.list.length - 1].id + } }, 100) }).catch(_ => { this.errorId = dialog_id @@ -3052,8 +3054,8 @@ export default { } }, - onActiveRange(array) { - this.startMsgId = $A.runNum(array.length > 0 ? array[0] : 0) + onVisible(v) { + this.startMsgId = $A.runNum(v.length > 0 ? v[0] : 0) }, onBack() {