Build your personal knowledge base with Trilium Notes
TypeScript electronelectron-appknowledge-baseknowledge-graphknowledge-managementknowledge-management-graphlocal-firstnote-managmentnote-takernote-takingnotebooknotesnotes-apppersonal-knowledge-basepersonal-wikiscriptableself-hostedself-hostingwiki
client/collections/board: fix an issue
Adorian Doran60693a5791c3
diff --git a/apps/client/src/widgets/collections/board/card_toolbar.css b/apps/client/src/widgets/collections/board/card_toolbar.cssindex a084bf7a6d..ffbf58d08b 100644--- a/apps/client/src/widgets/collections/board/card_toolbar.css+++ b/apps/client/src/widgets/collections/board/card_toolbar.css@@ -3,8 +3,9 @@display: contents;}-/* Nothing is offered while a card is carried; the rail comes back with the focus afterwards. */-.board-view-container.dragging .board-card-toolbar {+/* Hidden while a card is carried, under the class board_drag.ts sets on the container itself: a+ class rendered from state changes the attribute mid-drag and drops that one, and its auto-scroll. */+.board-view-container.board-dragging .board-card-toolbar {display: none;}diff --git a/apps/client/src/widgets/collections/board/index.spec.tsx b/apps/client/src/widgets/collections/board/index.spec.tsxindex 87f809f94e..bf41d46850 100644--- a/apps/client/src/widgets/collections/board/index.spec.tsx+++ b/apps/client/src/widgets/collections/board/index.spec.tsx@@ -4966,12 +4966,14 @@ describe("Card toolbar on mobile", () => {press("pointerdown");vi.advanceTimersByTime(1000);});- expect(board()?.classList.contains("dragging")).toBe(true);+ // The drag's own class, which the rail hides under. It must survive the board's redraw+ // on activation, or the auto-scroll it keeps working stops with it.+ expect(board()?.classList.contains("board-dragging")).toBe(true);await withTabManager(async () => {await act(async () => { press("pointerup"); });});- expect(board()?.classList.contains("dragging")).toBe(false);+ expect(board()?.classList.contains("board-dragging")).toBe(false);expect(document.activeElement).toBe(card("tool1"));expect(toolbar()).not.toBeNull();});diff --git a/apps/client/src/widgets/collections/board/index.tsx b/apps/client/src/widgets/collections/board/index.tsxindex 1c09aa0b7a..4c46a61d81 100644--- a/apps/client/src/widgets/collections/board/index.tsx+++ b/apps/client/src/widgets/collections/board/index.tsx@@ -1416,7 +1416,6 @@ export default function BoardView({className={clsx("board-view-container", {pannable: isPannable,panning: isPanning,- dragging: isDraggingItem,selecting: isSelecting})}onKeyDown={handleKeyDown}