fix: drag-to-scroll on all pages via central route-aware autorun

Page drag-to-scroll was wired into only boardsList (All Boards), myCards and
userFormsLayout (Login/Register). Every other defaultLayout page — Due Cards,
Global Search, Public, Bookmarks, Broken Cards, Settings, People, Admin
Reports, Attachments, Translation, Import, board Rules, Not Found — had no
page drag-scroll, and the per-template enable/disable calls fought each other
when navigating between two non-board pages (one template's onDestroyed
removed the class the next template's onRendered expected).

Replace them with a single route-aware autorun in defaultLayout (the
persistent shell that owns #content): non-board routes tag the real scroll
container (<body> + #content, so it works in both desktop and mobile mode),
and board-canvas routes (board/board-short/card) leave page tagging off so
their own .board-canvas.dragscroll handles dragging without double-scrolling
#content. Login/Register keep their own enable/disable (userFormsLayout has
no #content).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lauri OjansivuandClaude Opus 4.8 committed 2026-06-26 04:55:26 +03:00
1 parent 50525f6fd1
commit 88f353dc1f
4 files changed
+40 -25

No files matched your search

+10
View File
@@ -63,6 +63,16 @@ This release fixes the following bugs:
double-scroll). Touch one-finger scrolling (`dragscrollTouch.js`) already picks the nearest
scrollable `.dragscroll` ancestor, so `#content` wins over `<body>` when both are tagged.
Fixed in [37ac65e37](https://github.com/wekan/wekan/commit/37ac65e37).
- Drag-to-scroll now works on **every** whole-page layout in both mobile and desktop modes, not
just All Boards / My Cards / Login / Register. It was wired into only those few templates, so
Due Cards, Global Search, Public, Bookmarks, Broken Cards, Settings, People, Admin Reports,
Attachments, Translation, Import, board Rules and the Not Found page had no page drag-scroll at
all. The per-template enable/disable calls (which also fought each other when navigating between
two non-board pages) were replaced by a single route-aware autorun in `defaultLayout` (the
persistent shell that owns `#content`): every non-board route tags the real scroll container
(`<body>` + `#content`), and the board-canvas routes (`board` / `board-short` / `card`) leave it
off so their own `.board-canvas.dragscroll` keeps handling the drag. Login / Register keep their
own enable/disable because they use `userFormsLayout` (no `#content`).
# v9.72 2026-06-26 WeKan ® release
+3 -15
View File
@@ -2,8 +2,6 @@ import { ReactiveCache } from '/imports/reactiveCache';
import { TAPi18n } from '/imports/i18n';
import { FlowRouter } from 'meteor/ostrio:flow-router-extra';
import getSlug from 'limax';
import '/client/lib/dragscrollTouch';
import { enablePageDragscroll, disablePageDragscroll } from '/client/lib/pageDragscroll';
import TableVisibilityModeSettings from '/models/tableVisibilityModeSettings';
import { BoardMultiSelection } from '/client/lib/boardMultiSelection';
import { EscapeActions } from '/client/lib/escapeActions';
@@ -329,12 +327,9 @@ Template.boardList.onCreated(function () {
});
Template.boardList.onRendered(function () {
// Enable drag-to-scroll on the All Boards page the same way the board
// canvas/swimlanes do. On desktop the page scroll container is <body>, so we
// tag it via enablePageDragscroll(); the .board-list.dragscroll element only
// becomes a scroll container in mobile view, where its own class handles it.
// Finger drag-scrolling is handled by dragscrollTouch.js.
enablePageDragscroll();
// Drag-to-scroll on the All Boards page is handled centrally for all
// non-board pages by defaultLayout's route-aware autorun
// (see client/components/main/layouts.js).
// jQuery sortable is disabled in favor of HTML5 drag-and-drop for space management
// The old sortable code has been removed to prevent conflicts
@@ -380,13 +375,6 @@ Template.boardList.onRendered(function () {
*/
});
Template.boardList.onDestroyed(function () {
// Stop tagging <body> as drag-scrollable when leaving the All Boards page so
// other layouts (e.g. a board view, whose canvas does its own dragscroll) are
// not affected.
disablePageDragscroll();
});
Template.boardList.helpers({
userHasTeams() {
if (ReactiveCache.getCurrentUser()?.teams?.length > 0) return true;
+25
View File
@@ -314,6 +314,31 @@ Template.defaultLayout.onRendered(function () {
}
});
});
// Drag-to-scroll for every whole-page layout rendered inside defaultLayout
// (All Boards, My Cards, Due Cards, Global Search, Public, Bookmarks, Broken
// Cards, Settings, People, Admin, Import, board Rules, …). These pages scroll
// <body> on desktop and #content in mobile mode (where <body> is
// position:fixed), so enablePageDragscroll() tags whichever element actually
// scrolls. The board-canvas pages are the exception: their own
// `.board-canvas.dragscroll` handles dragging, and the canvas does its own
// vertical/horizontal scroll, so page-level tagging is turned off there to
// avoid scrolling #content and the canvas at the same time. defaultLayout is
// persistent (only its `content` swaps), so this single autorun covers every
// route without per-template wiring. Login / Register use userFormsLayout and
// keep their own enable/disable. Works the same in mobile and desktop mode.
const boardCanvasRoutes = ['board', 'board-short', 'card'];
this.autorun(() => {
FlowRouter.watchPathChange();
const onBoardCanvas = boardCanvasRoutes.includes(FlowRouter.getRouteName());
Tracker.afterFlush(() => {
if (onBoardCanvas) {
disablePageDragscroll();
} else {
enablePageDragscroll();
}
});
});
});
async function authentication(event, templateInstance) {
+2 -10
View File
@@ -1,6 +1,5 @@
import { CardSearchPaged } from '../../lib/cardSearch';
import { Utils } from '/client/lib/utils';
import { enablePageDragscroll, disablePageDragscroll } from '/client/lib/pageDragscroll';
Template.myCardsHeaderBar.helpers({
myCardsSort() {
@@ -41,15 +40,8 @@ Template.myCards.onCreated(function () {
Meteor.subscribe('setting');
});
Template.myCards.onRendered(function () {
// My Cards renders into <body>'s page scroll area (.wrapper inside #content),
// so enable drag-to-scroll on <body> like the All Boards page does.
enablePageDragscroll();
});
Template.myCards.onDestroyed(function () {
disablePageDragscroll();
});
// Drag-to-scroll is handled centrally for all non-board pages by
// defaultLayout's route-aware autorun (see client/components/main/layouts.js).
Template.myCards.helpers({
userId() {