Skip to content

ACT-008 Mark where a dragged item would land, and only while it is over that place

Level
Rule
Verdict
Unanimous (2 of 2)
Status
proposed, version 1.0.1

Rule

While something is being dragged, mark on screen the place that would receive it if it were let go now. Remove the mark as soon as the dragged thing leaves that place, is dropped or the drag is cancelled.

Examples

Live examples built with Justified's components. Try them with the mouse, the keyboard or a screen reader.

Do: A line in the gap where the row would go

Reading list

Space picks up and drops the item, the up and down arrow keys move it, Escape cancels.

  • Middlemarch
  • Persuasion
  • The Hobbit
  • Dracula

The still shows a row held over the third place with a 2-pixel line in the gap. Drag Middlemarch down by its handle: the line follows the pointer from gap to gap. Let go and the line is gone. Move the pointer off the list, or press Escape, and it is gone too. Space and the arrow keys show the same line.

Do: The column under the card, and only that one

Sprint board

Space picks up and drops the item, the up and down arrow keys move it, Escape cancels.

To do
  • Draft the FAQ
  • Update footer links
In progress
  • Fix login bug
Done
  • Write release notes

Drag Draft the FAQ across the board. The column under the card gets a thicker border and a light fill, so it differs in weight and tone as well as hue. The card inside it is not marked, so one place takes the drop. The mark moves on with the card and is cleared on a drop or on Escape.

Don't: Columns stay marked after the card has gone on

Sprint board

Space picks up and drops the item, the up and down arrow keys move it, Escape cancels.

To do
  • Draft the FAQ
  • Update footer links
In progress
  • Fix login bug
Done
  • Write release notes

Drag Draft the FAQ from the top to the bottom column. Each column it passes stays marked until the drop, so the still shows three at once and nobody can tell which one will take the card.

Don't: Only the border changes colour

Sprint board

Space picks up and drops the item, the up and down arrow keys move it, Escape cancels.

To do
  • Draft the FAQ
  • Update footer links
In progress
  • Fix login bug
Done
  • Write release notes

Drag Draft the FAQ over a column. Its 1-pixel border turns from grey (--input) to blue (--primary) with the same weight and no fill. The two differ by about 2.2 to 1 in lightness in the light theme and 1.8 to 1 in the dark one, under the 3:1 that VIS-003a asks for, so the change is a change of hue and little else, and it is easy to miss which column is meant.

Why

A drag is a promise made in advance: let go here and this will happen. Without a mark on the landing place, people let go and then look to see what they did, and a row in the wrong slot or a file that missed the zone is found only afterwards, if at all. A mark that stays after the item has moved on is worse, because it points at a place that will not get the drop. No WCAG criterion asks for a drop mark. Once there is one, WCAG 2.2, 1.4.11 Non-text Contrast asks 3:1 for the part people need to see it, and 1.4.1 Use of Color rules out a change of hue as the only sign. The mark is for people who can see the screen; what assistive technology hears is ACT-007b.

Do

  • In a sortable list Reading list built with dnd-kit, read the sortable over id and draw a 2px line in the gap where the row will go. Do not rely on rows shuffling through transform alone, which shows nothing when the layout does not move them.
  • On a board, read isOver from useDroppable on each column and give the column under the card a thicker border and a light fill.
  • With nested targets, such as a card inside a column, mark only the one that would take the drop.
  • In a react-dropzone area, change the zone while a file is over it, using isDragActive: a tinted fill with an upload icon and the text "Release to upload".
  • Clear the mark in onDragEnd and onDragCancel, so it is gone after a drop and after Escape.
  • Show the same mark during a keyboard move with dnd-kit's KeyboardSensor. Sighted keyboard users need it too.
  • Keep the drag-over mark distinct from the focus ring on a zone that can also be clicked (ACT-007a). They are different states; KBD-001 owns the ring.
  • Our own choice, beyond the rule: give the held item a raised look or a lighter copy that follows the pointer; show no mark, or a "not allowed" sign, over a place that cannot take the item; and on touch, draw the line ahead of the finger rather than under it.
  • When saving after a drop fails, FBK-002 applies. Our own choice: do not let the item snap back without a word. The item may sit in its new spot before the save is done, as STA-005a's exception for a change shown at once allows. A placeholder there while it saves, which follows STA-001, also works.

Don't

  • Let a column stay highlighted after the card has been carried on to the next one.
  • Mark a column and the card inside it at once, so it is unclear which one takes the drop.
  • Change only the hue of the zone's border, from one colour to another of about the same lightness, with no change in weight or fill. Without a 3:1 lightness difference, colour is the only sign (VIS-003a).
  • Leave a drop zone looking the same whether or not a file is over it.
  • Keep the mark on screen after the person pressed Escape.

Exceptions

  • No drag. A place that is chosen by pressing, such as the Move to menu in ACT-007a, needs no drop mark.
  • Neighbouring rules. The way without dragging is ACT-007a, the words for assistive technology are ACT-007b, and the focus ring is KBD-001.

Verdict

Unanimous (2 of 2). Only the judges decide; the expert witnesses are shown but do not vote. How verdicts work

Stances on ACT-008
SourceRoleStancePage
WCAG 2.2LawSupports1.4.11 Non-text Contrast
WCAG 2.2LawSupports1.4.1 Use of Color
Material DesignJudge No position
Apple Human Interface GuidelinesJudge SupportsDrag and drop
Gestures
Carbon Design SystemJudge SupportsFile uploader usage
GOV.UK Design SystemExpert witness SupportsFile upload
Nielsen Norman GroupExpert witness SupportsDrag–and–Drop: How to Design for Ease of Use, by Page Laubheimer

Each stance links to the page it rests on, read on the date in the source register. This page never repeats what a source says; read the source itself.

History

  • Version 1.0.1, : The item in its new spot before the save is done now points to STA-005a's exception for a change shown at once.
  • Version 1.0.0, : First version.

Last checked against the other rules for conflicts on .

More in Actions: 11 rules and 4 guidelines · All rules