Files
wekan/docs/Features/DragDrop/Drag-Drop.md
T
Lauri Ojansivu 7e1f9e89eb Docs: every feature topic in one folder under docs/Features, each with README.md as its main page.
- The General/ level is gone: its 109 files moved up into the folders of the
  same name, and its topic table is the "Shared topics" section of
  Features.md.
- Accessibility is one folder, docs/Features/Accessibility/, with the Admin
  Panel's accessibility page in it.
- Every folder's main page is README.md (110 X/X.md pages renamed with git mv,
  five merged with an existing README.md, 26 index pages added for folders
  that had none), so a folder opened on GitHub shows its page.
- The 73 "# Moved" forwarding pages are deleted, with the folders that held
  only them; every link that went to one goes to its final page.
- docs/Features/README.md has the website's "Features in WeKan" overview,
  each feature linking to its page here.

1,129 Markdown links in 262 files and 352 doc paths in code, tests, compose,
snap and release files follow. tests/docsFeaturesLayout.test.cjs fails when
General/ or a "# Moved" page comes back, a folder has no README.md, or a
relative link in the docs or README.md does not resolve.

Thanks to xet7 !
2026-11-24 20:02:06 +02:00

5.9 KiB

Drag and drop

What it is

Drag and drop is how you reorder things in WeKan: grab a board icon, swimlane, list, minicard, checklist or checklist item and drop it where it should be. On a touch screen, drag handles keep the rest of the item free, so dragging the board itself pans it instead of moving a card. What a user may drag depends on their role.

Read more

How to use it

  1. Grab the item (or its drag handle, when handles are shown) and move it.
  2. Drop it between two others; a list moved to another swimlane on a touch screen asks for confirmation first.
  3. Press Ctrl+Z to undo a move you did not mean.

The mobile, All Boards, board and search-result cases are described below.

How the numbers are calculated

A dropped item gets a new sort number between its new neighbours (calculateIndexData() in client/lib/utils.js):

  • into an empty list: 0, then 1, 2, ... for several items;
  • before the first item: a whole number just below the next item's sort when one fits, else next - 1;
  • after the last item: a whole number just above the previous item's sort when one fits, else previous + 1;
  • between two items: a whole number between them when one fits, otherwise the step (next - previous) / (items + 1), so several dropped items are spaced evenly.

Whether handles show is resolveShowDragHandles(preference, isTouchScreen) in models/lib/dragHandles.js: on when the user turned them on, off when they turned them off, and when never chosen, on for a touch screen and off for a mouse.

How it works in WeKan

Swimlanes, lists, minicards, checklists and checklist items are jQuery UI sortables (.sortable() in client/components/swimlanes/swimlanes.js, client/components/lists/list.js, client/components/cards/checklists.js, with shared options in client/lib/sortableOptions.js); board icons on All Boards use HTML5 drag and drop, which client/lib/dragDropTouch.js starts from a long press on a touch screen. The server checks the role of every move. Tests include tests/dragHandles.test.cjs and tests/dragDropTouch.test.cjs.

Roles

It depends on role of user what drag drop is allowed REST API Role

Mobile Drag Drop

  1. Click the drag handles button (the arrows icon, titled Show desktop drag handles) in the header bar, or the same entry in the member menu, to enable drag handles

  2. Use drag handles to move Board Icons, Swimlanes, MiniCards, Lists, Checklists, Checklist Items.

  3. Use non-drag-handle area to to view other parts of board, by dragging board up/down/left/right, without moving any icons etc.

Mobile drag drop

2 or more external screens of desktop or mobile

For each screen, you could enable or disable drag handles, because that setting was stored in browser localstorage, not to database. https://github.com/wekan/wekan/issues/4715

That has changed: for a logged-in user the choice is now saved in the user profile (profile.showDesktopDragHandles, through the toggleDesktopDragHandles method), so it follows the user to every screen. Only when nobody is logged in is it kept in the browser's localStorage. A user who never chose gets handles on a touch screen and none with a mouse.

Because this feature was added, Drag Handle Enabled/Disabled was moved to current place shown in above screenshot. https://github.com/wekan/wekan/issues/4734 It is now titled Show desktop drag handles, with a check mark while it is on.

All Boards page

Reorder with drag drop:

  • Board Icons

One Board page

Reorder with drag drop:

  • Swimlanes
  • Lists
  • MiniCards. MiniCard is card, that is not click opened to view card contents.
  • Opened Card: Checklists
  • Opened Card: Checklist Items

Drag code examples

Touch UI ideas

Drag and drop from search results

Cards shown in the board search results list can be dragged directly onto a board list / column. In this initial version the card is dropped at the end of the target list (pixel-precise insertion position is not supported yet).

Commits