mirror of
https://github.com/kuaifan/dootask.git
synced 2025-12-12 11:19:56 +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;
|
isTouch = false;
|
||||||
binding.value("up");
|
binding.value("up");
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
click: e => {
|
||||||
|
binding.value("click", e);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if (isSupportTouch) {
|
if (isSupportTouch) {
|
||||||
@ -29,6 +32,7 @@ export default {
|
|||||||
document.addEventListener('mousemove', el.__touchEvent__.move);
|
document.addEventListener('mousemove', el.__touchEvent__.move);
|
||||||
document.addEventListener('mouseup', el.__touchEvent__.end);
|
document.addEventListener('mouseup', el.__touchEvent__.end);
|
||||||
}
|
}
|
||||||
|
el.addEventListener('click', el.__touchEvent__.click);
|
||||||
},
|
},
|
||||||
update () {
|
update () {
|
||||||
|
|
||||||
@ -43,6 +47,7 @@ export default {
|
|||||||
document.removeEventListener('mousemove', el.__touchEvent__.move);
|
document.removeEventListener('mousemove', el.__touchEvent__.move);
|
||||||
document.removeEventListener('mouseup', el.__touchEvent__.end);
|
document.removeEventListener('mouseup', el.__touchEvent__.end);
|
||||||
}
|
}
|
||||||
|
el.removeEventListener('click', el.__touchEvent__.click);
|
||||||
delete el.__touchEvent__;
|
delete el.__touchEvent__;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@ -320,6 +320,7 @@ export default {
|
|||||||
recordDuration: 0,
|
recordDuration: 0,
|
||||||
|
|
||||||
touchStart: {},
|
touchStart: {},
|
||||||
|
touchFocus: false,
|
||||||
touchLimitX: false,
|
touchLimitX: false,
|
||||||
touchLimitY: false,
|
touchLimitY: false,
|
||||||
|
|
||||||
@ -1019,6 +1020,7 @@ export default {
|
|||||||
}
|
}
|
||||||
switch (action) {
|
switch (action) {
|
||||||
case 'down':
|
case 'down':
|
||||||
|
this.touchFocus = this.quill?.hasFocus();
|
||||||
this.touchLimitX = false;
|
this.touchLimitX = false;
|
||||||
this.touchLimitY = false;
|
this.touchLimitY = false;
|
||||||
this.touchStart = event.type === "touchstart" ? event.touches[0] : event;
|
this.touchStart = event.type === "touchstart" ? event.touches[0] : event;
|
||||||
@ -1048,6 +1050,13 @@ export default {
|
|||||||
}
|
}
|
||||||
this.onSend()
|
this.onSend()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'click':
|
||||||
|
if (this.touchFocus) {
|
||||||
|
this.quill.blur();
|
||||||
|
this.quill.focus();
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user