Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:art: https://github.com/siyuan-note/siyuan/issues/17612

Vanessa4b3d472ebb25
diff --git a/app/src/assets/scss/business/_av.scss b/app/src/assets/scss/business/_av.scss
index dd3c2e72b0..7efeaff5ab 100644
--- a/app/src/assets/scss/business/_av.scss
+++ b/app/src/assets/scss/business/_av.scss
@@ -747,6 +747,7 @@
border-radius: 50%;
box-sizing: border-box;
cursor: ns-resize;
+ touch-action: none;
}
&__celltext {
@@ -816,6 +817,7 @@
right: -2.5px;
transition: var(--b3-background-transition);
z-index: 1;
+ touch-action: none;
&:hover {
background-color: var(--b3-theme-primary);
diff --git a/app/src/assets/scss/business/_layout.scss b/app/src/assets/scss/business/_layout.scss
index 19a5439865..31ca25b0ae 100644
--- a/app/src/assets/scss/business/_layout.scss
+++ b/app/src/assets/scss/business/_layout.scss
@@ -402,10 +402,3 @@
}
}
}
-
-/* Touch drag support for dialog and editor resize handles */
-[class*="resize__"],
-.av__widthdrag,
-.av__drag-fill {
- touch-action: none;
-}
diff --git a/app/src/assets/scss/business/_resize.scss b/app/src/assets/scss/business/_resize.scss
index 7729352cb4..d74826f0ff 100644
--- a/app/src/assets/scss/business/_resize.scss
+++ b/app/src/assets/scss/business/_resize.scss
@@ -9,6 +9,7 @@
&__t,
&__d {
position: absolute;
+ touch-action: none;
}
&__rd {
diff --git a/app/src/boot/globalEvent/dragover.ts b/app/src/boot/globalEvent/dragover.ts
index 90f0fbe60a..177bb833a6 100644
--- a/app/src/boot/globalEvent/dragover.ts
+++ b/app/src/boot/globalEvent/dragover.ts
@@ -53,7 +53,7 @@ const scrollAnimation = (timestamp: number) => {
dragoverScroll.lastTime = timestamp;
};
-export const dragOverScroll = (moveEvent: MouseEvent | { clientY: number }, contentRect: DOMRect, element: Element) => {
+export const dragOverScroll = (moveEvent: MouseEvent, contentRect: DOMRect, element: Element) => {
const dragToUp = moveEvent.clientY < contentRect.top + Constants.SIZE_SCROLL_TB;
if (dragToUp ||
moveEvent.clientY > contentRect.bottom - Constants.SIZE_SCROLL_TB) {
diff --git a/app/src/boot/globalEvent/event.ts b/app/src/boot/globalEvent/event.ts
index d7ea7a23cc..58cb18eedf 100644
--- a/app/src/boot/globalEvent/event.ts
+++ b/app/src/boot/globalEvent/event.ts
@@ -150,7 +150,12 @@ export const initWindowEvent = (app: App) => {
// 触摸屏背景和嵌入块按钮显示
globalTouchStart(event);
}, false);
+
document.addEventListener("touchend", (event) => {
+ if (window.siyuan.touchDragActive) {
+ return;
+ }
+ // pad 端长按事件
if (isIPad()) {
// https://github.com/siyuan-note/siyuan/issues/9113
if (globalTouchEnd(event, undefined, time, app)) {
@@ -158,9 +163,6 @@ export const initWindowEvent = (app: App) => {
event.preventDefault();
return;
}
- if (window.siyuan.touchDragActive) {
- return;
- }
if (new Date().getTime() - time <= 900) {
return;
}
diff --git a/app/src/protyle/util/editorCommonEvent.ts b/app/src/protyle/util/editorCommonEvent.ts
index 676cc74cfe..c81a1cd21e 100644
--- a/app/src/protyle/util/editorCommonEvent.ts
+++ b/app/src/protyle/util/editorCommonEvent.ts
@@ -20,8 +20,7 @@ import {getAllEditor} from "../../layout/getAll";
import {updatePanelByEditor} from "../../editor/util";
/// #endif
import {blockRender} from "../render/blockRender";
-/// #else
-import {uploadFiles, uploadLocalFiles} from "../upload";
+import {uploadLocalFiles} from "../upload";
import {insertHTML} from "./insertHTML";
import {isBrowser} from "../../util/functions";
import {hideElements} from "../ui/hideElements";
@@ -31,6 +30,8 @@ import {setFold, zoomOut} from "../../menus/protyle";
/// #if !BROWSER
import {webUtils} from "electron";
import {dragUpload} from "../render/av/asset";
+/// #else
+import {uploadFiles} from "../upload";
/// #endif
import {addDragFill, getTypeByCellElement} from "../render/av/cell";
import {processClonePHElement} from "../render/util";