Fix trackpad not switching tabs.

This commit is contained in:
SiriusXT 2025-04-15 23:38:08 +08:00
parent 897fde7332
commit d1c2672f99
2 changed files with 3 additions and 9 deletions

View File

@ -13,7 +13,7 @@ declare module "draggabilly" {
containment: HTMLElement
});
element: HTMLElement;
on(event: "pointerDown" | "pointerUp" | "dragStart" | "dragEnd" | "dragMove", callback: Callback);
on(event: "staticClick" | "dragStart" | "dragEnd" | "dragMove", callback: Callback);
dragEnd();
isDragging: boolean;
positionDrag: () => void;

View File

@ -676,14 +676,8 @@ export default class TabRowWidget extends BasicWidget {
this.draggabillies.push(draggabilly);
let pointerDownTime: number = 0;
draggabilly.on("pointerDown", () => {
pointerDownTime = Date.now();
});
draggabilly.on("pointerUp", () => {
if (Date.now() - pointerDownTime < 200) {
appContext.tabManager.activateNoteContext(tabEl.getAttribute("data-ntx-id"));
}
draggabilly.on("staticClick", () => {
appContext.tabManager.activateNoteContext(tabEl.getAttribute("data-ntx-id"));
});
draggabilly.on("dragStart", () => {