🎨 The toolbar content cannot be slid on Android https://github.com/siyuan-note/siyuan/issues/14979

This commit is contained in:
Daniel 2025-06-07 10:43:46 +08:00
parent 084ddfd389
commit a37e23bf5f
No known key found for this signature in database
GPG key ID: 86211BA83DF03017

View file

@ -521,13 +521,15 @@ export const initKeyboardToolbar = () => {
</div>
<div class="keyboard__util"></div>`;
let startY = 0;
let startX = 0;
let moved = false;
toolbarElement.addEventListener("touchstart", e => {
startY = e.touches[0].clientY;
startX = e.touches[0].clientX;
moved = false;
});
toolbarElement.addEventListener("touchmove", e => {
if (Math.abs(e.touches[0].clientY - startY) > 10) {
if (Math.abs(e.touches[0].clientY - startY) > 10 || Math.abs(e.touches[0].clientX - startX) > 10) {
moved = true;
}
});