mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-21 17:20:19 +00:00
perf: 优化快捷表情发送消息时关闭延迟的问题
This commit is contained in:
parent
976b9690d2
commit
e67ce9a438
@ -699,9 +699,13 @@ export default {
|
|||||||
|
|
||||||
// Update model if text changes
|
// Update model if text changes
|
||||||
this.quill.on('text-change', _ => {
|
this.quill.on('text-change', _ => {
|
||||||
|
if (this.textTimer) {
|
||||||
|
clearTimeout(this.textTimer)
|
||||||
|
} else {
|
||||||
this.changeLoad++
|
this.changeLoad++
|
||||||
this.textTimer && clearTimeout(this.textTimer)
|
}
|
||||||
this.textTimer = setTimeout(_ => {
|
this.textTimer = setTimeout(_ => {
|
||||||
|
this.textTimer = null
|
||||||
this.changeLoad--
|
this.changeLoad--
|
||||||
if (this.maxlength > 0 && this.quill.getLength() > this.maxlength) {
|
if (this.maxlength > 0 && this.quill.getLength() > this.maxlength) {
|
||||||
this.quill.deleteText(this.maxlength, this.quill.getLength());
|
this.quill.deleteText(this.maxlength, this.quill.getLength());
|
||||||
@ -1032,6 +1036,8 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
onSend(type) {
|
onSend(type) {
|
||||||
|
this.emojiQuickShow = false;
|
||||||
|
//
|
||||||
setTimeout(_ => {
|
setTimeout(_ => {
|
||||||
if (this.filterInvalidLine(this.value) === '') {
|
if (this.filterInvalidLine(this.value) === '') {
|
||||||
return
|
return
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user