Testing

HTML Drag and Drop API: Browser Support, Events, Issues

The HTML Drag and Drop API works in Chrome 4+, Edge 18+, Firefox 3.5+, Safari 3.1+, and Safari iOS 15+. Learn the events, browser support, and known issues.

Author

Prince Dewani

May 1, 2025

The HTML Drag and Drop API is a WHATWG specification that lets web pages drag elements, text, and files within a page or from the operating system. It works in Chrome 4+, Edge 18+, Firefox 3.5+, Safari 3.1+ on macOS, Safari 15+ on iOS, Opera 12+, and Samsung Internet 14+, while Internet Explorer never shipped full support.

This guide covers what the API is, the browsers that support it, the drag events, how to feature-detect it, and the known issues.

What is the HTML Drag and Drop API?

The HTML Drag and Drop API is a WHATWG specification that lets web pages drag and drop elements, selections, text, and files. The HTML Living Standard at WHATWG defines the DragEvent interface, the DataTransfer object, and the draggable attribute that turn any DOM node into a drag source or a drop target.

Which browsers does the HTML Drag and Drop API support?

Every modern desktop browser supports the HTML Drag and Drop API for mouse and trackpad input, with global usage above 94%. Mobile finger-drag support is the gap to plan around.

Loading browser compatibility data...

HTML Drag and Drop API compatibility in Chrome

Chrome supports the HTML Drag and Drop API from Chrome 4 on Windows, macOS, Linux, and ChromeOS. All seven DragEvent handlers, dataTransfer.setData, dataTransfer.files, and HTMLImageElement-based setDragImage have worked since Chrome 4. Chrome 21+ also accepts folder drops via dataTransfer.items.webkitGetAsEntry.

HTML Drag and Drop API compatibility in Edge

Microsoft Edge supports the HTML Drag and Drop API from Edge 18 on Windows. Pre-Chromium EdgeHTML 12 to 17 had partial support that missed parts of dataTransfer.items and the file-drop pipeline. Chromium-based Edge 79+ on Windows, macOS, Linux, and Android tracks Chrome and ships full support.

HTML Drag and Drop API compatibility in Firefox

Firefox supports the HTML Drag and Drop API from Firefox 3.5 on Windows, macOS, and Linux. Firefox accepts any DOM node as the second argument to dataTransfer.setDragImage, including off-screen elements. Firefox for Android does not fire DragEvent from a finger touch.

HTML Drag and Drop API compatibility in Safari on macOS

Safari on macOS supports the HTML Drag and Drop API from Safari 3.1. Every later macOS Safari ships the same DragEvent surface, dataTransfer access, and File-object drops. Safari requires an HTMLImageElement or a DOM-attached node inside the viewport for setDragImage, otherwise the drag thumbnail falls back to the source element.

HTML Drag and Drop API compatibility in Safari on iOS and iPadOS

Safari on iOS and iPadOS supports the HTML Drag and Drop API from iOS 15 and iPadOS 15. Apple wired DragEvent into WebKit alongside iPadOS pointer support, so iPad and iPhone Safari fire dragstart, dragover, and drop from a Bluetooth mouse, an external trackpad, or an Apple Pencil. iOS 3.2 to 14.x had no DragEvent, and Chrome, Edge, and Firefox on iOS inherit the same gap because every iOS browser uses WebKit.

HTML Drag and Drop API compatibility in Opera

Opera supports the HTML Drag and Drop API from Opera 12 on Windows, macOS, and Linux. Opera Mobile 12.1+ supports it on Android, tracking the underlying Chromium engine since the Blink switchover. Opera 9 to 11.6 and Opera Mini do not fire DragEvent; load a polyfill like mobile-drag-drop for those visitors.

HTML Drag and Drop API compatibility in Samsung Internet

Samsung Internet exposes the DragEvent JavaScript surface on every Galaxy phone running its Chromium pipeline, but typical finger-touch sessions do not fire drag events. A Bluetooth mouse, a DeX-mode pointer, or an S Pen on a Galaxy Tab can drive drag and drop. Pair the API with a Pointer Events fallback for finger input.

HTML Drag and Drop API compatibility in Android Browser

The legacy stock Android Browser, last shipped with Android 4.4 KitKat, never supported the HTML Drag and Drop API in full. Chrome for Android, Samsung Internet, and Firefox for Android replaced it on every Android 5.0+ device. Mouse or trackpad input on a ChromeOS or DeX device is the only path to fire DragEvent on Android.

HTML Drag and Drop API compatibility in Internet Explorer

Internet Explorer 5.5 to 11 expose a pre-HTML5 drag-and-drop surface that misses dataTransfer.items, file drops, and the modern DataTransferItemList. Microsoft has retired Internet Explorer 11 from support, so move drag-and-drop-dependent web apps to Chromium-based Edge or Chrome for full DragEvent coverage.

Note

Note: HTML Drag and Drop API behavior shifts across Safari, mobile Chrome, and Samsung Internet. Test it on real browsers and OS with TestMu AI. Try TestMu AI free!

What are the HTML Drag and Drop events?

The HTML Drag and Drop API defines seven DragEvent types that fire on the source element and the drop target as the user drags, hovers, and releases. Wire only the events your app actually needs.

  • dragstart: Fires on the source element when the user starts dragging. Populate event.dataTransfer.setData with the MIME type and payload the drop target reads.
  • drag: Fires every few hundred milliseconds on the source while the drag is active. Most apps skip it because dragover already covers UI updates on the target.
  • dragenter: Fires on a potential drop target when the dragged item first enters its bounding box. Call event.preventDefault() to mark the element as a valid drop zone.
  • dragover: Fires repeatedly on the target while the dragged item is over it. Always call event.preventDefault() inside this handler, or the drop event never fires.
  • dragleave: Fires when the dragged item leaves the target. Use it to clear hover styles like a dashed outline.
  • drop: Fires on the target when the user releases the dragged item. Read event.dataTransfer.getData or event.dataTransfer.files to grab the payload.
  • dragend: Fires on the source after the drag finishes, whether the drop succeeded or the user cancelled. Use it to reset source-side UI state.
  • DragEvent.dataTransfer: The single property attached to every drag event. It exposes setData, getData, files, items, types, effectAllowed, dropEffect, and setDragImage.

How do you check if a browser supports the HTML Drag and Drop API?

Test for the draggable attribute on a sample element and the DragEvent constructor on window. Both checks are stable across Chrome, Edge, Firefox, Safari, Opera, and Samsung Internet, so a single in check separates supported browsers from legacy IE and the old Android Browser.

// Paste this into the DevTools console of any browser to confirm
// HTML Drag and Drop API support before wiring drag handlers.
const probe = document.createElement("div");

const supportsDragAndDrop =
  "draggable" in probe &&
  "ondragstart" in probe &&
  "ondrop" in probe &&
  typeof DragEvent === "function" &&
  typeof DataTransfer === "function";

if (supportsDragAndDrop) {
  console.log("HTML Drag and Drop API is supported in this browser.");
} else {
  console.log("HTML Drag and Drop API is missing. Use a Pointer Events fallback.");
}

// Touch input is a separate concern. Mobile Chrome, Firefox for Android,
// and Samsung Internet do not fire DragEvent from a finger.
if ("ontouchstart" in window) {
  console.log("Touchscreen detected. Add a mobile-drag-drop polyfill for finger drags.");
}

If the console prints "HTML Drag and Drop API is supported" but a finger drag still does nothing, the device is on Chrome for Android, Firefox for Android, or Samsung Internet. Use a Pointer Events polyfill like mobile-drag-drop for finger input on those browsers.

...

What are the known issues with the HTML Drag and Drop API?

The HTML Drag and Drop API is broadly available on desktop, but mobile touch input, the unimplemented dropzone attribute, and quirks in dataTransfer.items and setDragImage still trip up production apps.

  • No touchscreen drag on mobile: Chrome for Android, Firefox for Android, and Samsung Internet do not fire DragEvent from a finger. Only a mouse, a trackpad, or an Apple Pencil on iPadOS 15+ triggers it. Ship a Pointer Events fallback for touch users.
  • The dropzone attribute is dead: No browser shipped the HTML5 dropzone attribute. Use a JavaScript dragover handler that calls event.preventDefault() to mark drop targets instead.
  • dataTransfer.items differs across engines: Chromium exposes the full DataTransferItemList with both string and File items; Firefox and Safari implement most of it but skip directories. Read event.dataTransfer.files for file drops to stay portable.
  • setDragImage compatibility varies: Firefox accepts any DOM node, including off-screen ones. Chrome and Safari require an HTMLImageElement or a DOM-attached node inside the viewport, or the drag thumbnail falls back to the source.
  • iOS gap until Safari 15: iPhones and iPads on iOS 14 and earlier never shipped DragEvent. Safari 15 added it for pointer and external trackpad input on iPadOS, and Chrome, Edge, and Firefox on iOS inherit it through WebKit.
  • Internet Explorer is partial only: IE 5.5 to 11 expose a pre-HTML5 drag-and-drop surface that misses dataTransfer.items and file drops. The cleanest path is to drop IE support and migrate users to Chromium-based Edge.
  • Cross-origin iframe drags are restricted: A drag that starts in one origin and lands in another iframe is gated by the same-origin policy. The drop target receives empty dataTransfer.types and dataTransfer.files when the source is cross-origin.

In my experience, the trap that bites every drag-and-drop integration once is the missing dragover preventDefault. The dragstart fires, the dragenter fires, but drop silently never fires because the target never marked itself as a drop zone. Always preventDefault inside dragover and the surprise goes away.

...

Citations

All HTML Drag and Drop API version numbers and platform notes in this guide come from these primary sources:

Author

Prince Dewani is a Community Contributor at TestMu AI, where he manages content strategies around software testing, QA, and test automation. He is certified in Selenium, Cypress, Playwright, Appium, Automation Testing, and KaneAI. Prince has also presented academic research at the international conference PBCON-01. He further specializes in on-page SEO, bridging marketing with core testing technologies. On LinkedIn, he is followed by 4,300+ QA engineers, developers, DevOps experts, tech leaders, and AI-focused practitioners in the global testing community.

Open in ChatGPT Icon

Open in ChatGPT

Open in Claude Icon

Open in Claude

Open in Perplexity Icon

Open in Perplexity

Open in Grok Icon

Open in Grok

Open in Gemini AI Icon

Open in Gemini AI

Copied to Clipboard!
...

3000+ Browsers. One Platform.

See exactly how your site performs everywhere.

Try it free
...

Write Tests in Plain English with KaneAI

Create, debug, and evolve tests using natural language.

Try for free

Frequently asked questions

Did you find this page helpful?

More Related Hubs

TestMu AI forEnterprise

Get access to solutions built on Enterprise
grade security, privacy, & compliance

  • Advanced access controls
  • Advanced data retention rules
  • Advanced Local Testing
  • Premium Support options
  • Early access to beta features
  • Private Slack Channel
  • Unlimited Manual Accessibility DevTools Tests