Skip to content

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

:art: 多选单元格自动滚动

Vanessadc8ced773c36
diff --git a/app/src/protyle/wysiwyg/index.ts b/app/src/protyle/wysiwyg/index.ts
index fb020a0261..7a40cdf469 100644
--- a/app/src/protyle/wysiwyg/index.ts
+++ b/app/src/protyle/wysiwyg/index.ts
@@ -532,8 +532,23 @@ export class WYSIWYG {
const originIndex = getPositionByCellElement(avCellElement);
let moveCellElement: HTMLElement;
let lastCellElement: HTMLElement;
+ const nodeRect = nodeElement.getBoundingClientRect();
+ const scrollElement = nodeElement.querySelector(".av__scroll");
+ const contentRect = protyle.contentElement.getBoundingClientRect();
documentSelf.onmousemove = (moveEvent: MouseEvent) => {
const tempCellElement = hasClosestByClassName(moveEvent.target as HTMLElement, "av__cell") as HTMLElement;
+ if (scrollElement.scrollWidth > scrollElement.clientWidth + 2) {
+ if (moveEvent.clientX > nodeRect.right - 10) {
+ scrollElement.scrollLeft += 10;
+ } else if (moveEvent.clientX < nodeRect.left + 34) {
+ scrollElement.scrollLeft -= 10;
+ }
+ if (moveEvent.clientY < contentRect.top + 48) {
+ protyle.contentElement.scrollTop -= 5;
+ } else if (moveEvent.clientY > contentRect.bottom - 48) {
+ protyle.contentElement.scrollTop += 5;
+ }
+ }
if (moveCellElement && tempCellElement && tempCellElement.isSameNode(moveCellElement)) {
return;
}