Skip to Content
Platform.Ontology

Drag and drop

Lets people drag items within or into the page, and lets the page start drags.

Does something on your deviceThings a page can doInteractionWeb browsersWhile you use it

In one line

Can let you drag items on the page, or drop files onto it

Lets people drag items within or into the page, and lets the page start drags.

A site can start a drag with text, links or files, and react when people drop things on it. Data in a drag is readable only on drop, so the page cannot spy on a drag it does not own.

What it can and can't do

What the user does: You drag a file, text or picture onto the page, or drag an item inside it.

It can

  • Accept files you drop onto the page, such as photos or documents
  • Let you rearrange items by dragging, like cards or lists
  • Start a drag so you can pull text or an image out of the page

It cannot

  • See your files before you drop them
  • See files you did not drop
  • Browse your folders on its own
  • Take over dragging from other apps or windows

Browser support

Chromeworks
Edgeworks
Firefoxworks
Safariworks
iPhoneworks
Androidworks
Samsungworks
BrowserStatusFirst versionReleasedNote
ChromeSupported32009-09-15None
EdgeSupported122015-07-29None
FirefoxSupported3.52009-06-30None
SafariSupported42009-06-08None
Safari on iPhoneSupported3.22010-04-03All iOS browsers use WebKit
Chrome on AndroidSupported182012-06-27None
Samsung InternetSupported1.02013-04-27None

How a site asks for it

APIdragstart, dragover, drop events; DataTransfer; draggable=true
Browser compat keysapi.DataTransfer
api.HTMLElement.dragstart_event
api.DataTransferItem.getAsFileSystemHandle
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureNo
Activationnone
How long it lastsPer drag operation
How to take it backNothing to revoke (no permission is stored)
Inside an iframeDragging across iframes allowed; dropped data readable only in the drop handler

Typical flow

  1. Person drags an item over the page
  2. dragover must call preventDefault to accept
  3. drop fires with dataTransfer

Data you get

Shape: none

No individual data fields. The signal is the access itself.

Technical limits

  • dataTransfer is in protected mode outside drop: types are visible, data is not readable until drop
  • Cannot start an OS file drag from the page except the Chrome only DownloadURL type trick
  • Dropped files expose name, size, type, lastModified; no full path
  • Touch support: iOS Safari 11 (iPad and iPhone); Android Chrome supports long-press drag since Chrome 96 on some devices
  • Drag image limited to a rendered element or image; size capped by the OS

The story

What it is

People can drag things around the page, or drop files onto it.

For you

You pick up a card, a file or a photo with your mouse or finger and drop it somewhere else. It feels natural, so you rarely think about it.

For makers

Makers use it to make web apps feel like real software: reordering lists, uploading by dropping a file, building layouts. It also boosts upload completion because dropping is easier than browsing folders.

Where you see it

TypeExampleApps
productivityYou drag a task card from To Do to Done in a project board.Trello, Notion, Jira
creativeYou drop a photo onto a design canvas and it appears where you let go.Figma, Canva
gamesYou drag pieces on a browser puzzle or card game, like moving a card in solitaire.None named
messagingYou drag a file into a chat window to send it.Slack, Gmail
mediaYou drag songs into a playlist order on a web music player.Spotify web player
shoppingYou drag a product into a wish list or onto a compare bar.None named

Risks

  • Accidental drops
  • Dropped files read by the page

What the platform says

Good uses and abuse

Legitimate uses

  • File upload zones
  • Kanban boards
  • Editors

Known abuse

  • Drop-zone social engineering (fake upload prompts)
  • Exfil of dropped sensitive files into the wrong site

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility4 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2017-09, Safari 11: Touch drag and drop on iOS 11 and iPadOS
  • 2020-05, Chrome 86: DataTransferItem.getAsFileSystemHandle for dropped files

Sources

How well checked: Based on official documentation.

On this page