mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 03:01:12 +00:00
perf: 优化Android点击发送按钮效果
This commit is contained in:
parent
2bda6bf668
commit
6880baa6a4
5
resources/assets/js/directives/touchmouse.js
vendored
5
resources/assets/js/directives/touchmouse.js
vendored
@ -18,6 +18,9 @@ export default {
|
||||
isTouch = false;
|
||||
binding.value("up");
|
||||
}
|
||||
},
|
||||
click: e => {
|
||||
binding.value("click", e);
|
||||
}
|
||||
};
|
||||
if (isSupportTouch) {
|
||||
@ -29,6 +32,7 @@ export default {
|
||||
document.addEventListener('mousemove', el.__touchEvent__.move);
|
||||
document.addEventListener('mouseup', el.__touchEvent__.end);
|
||||
}
|
||||
el.addEventListener('click', el.__touchEvent__.click);
|
||||
},
|
||||
update () {
|
||||
|
||||
@ -43,6 +47,7 @@ export default {
|
||||
document.removeEventListener('mousemove', el.__touchEvent__.move);
|
||||
document.removeEventListener('mouseup', el.__touchEvent__.end);
|
||||
}
|
||||
el.removeEventListener('click', el.__touchEvent__.click);
|
||||
delete el.__touchEvent__;
|
||||
}
|
||||
};
|
||||
|
||||
@ -320,6 +320,7 @@ export default {
|
||||
recordDuration: 0,
|
||||
|
||||
touchStart: {},
|
||||
touchFocus: false,
|
||||
touchLimitX: false,
|
||||
touchLimitY: false,
|
||||
|
||||
@ -1019,6 +1020,7 @@ export default {
|
||||
}
|
||||
switch (action) {
|
||||
case 'down':
|
||||
this.touchFocus = this.quill?.hasFocus();
|
||||
this.touchLimitX = false;
|
||||
this.touchLimitY = false;
|
||||
this.touchStart = event.type === "touchstart" ? event.touches[0] : event;
|
||||
@ -1048,6 +1050,13 @@ export default {
|
||||
}
|
||||
this.onSend()
|
||||
break;
|
||||
|
||||
case 'click':
|
||||
if (this.touchFocus) {
|
||||
this.quill.blur();
|
||||
this.quill.focus();
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user