Explorar el Código

:art: fix https://github.com/siyuan-note/siyuan/issues/9516

Vanessa hace 1 año
padre
commit
4347d12af0
Se han modificado 1 ficheros con 7 adiciones y 0 borrados
  1. 7 0
      app/src/layout/dock/Files.ts

+ 7 - 0
app/src/layout/dock/Files.ts

@@ -421,6 +421,13 @@ export class Files extends Model {
             if (window.siyuan.config.readonly) {
                 return;
             }
+            const contentRect = this.element.getBoundingClientRect();
+            if (event.clientY < contentRect.top + Constants.SIZE_SCROLL_TB || event.clientY > contentRect.bottom - Constants.SIZE_SCROLL_TB) {
+                this.element.scroll({
+                    top: this.element.scrollTop + (event.clientY < contentRect.top + Constants.SIZE_SCROLL_TB ? -Constants.SIZE_SCROLL_STEP : Constants.SIZE_SCROLL_STEP),
+                    behavior: "smooth"
+                });
+            }
             let liElement = hasClosestByTag(event.target, "LI");
             if (!liElement) {
                 liElement = hasClosestByTag(document.elementFromPoint(event.clientX, event.clientY - 1), "LI");