The JavaScript Drag & Drop library your grandparents warned you about.
The JavaScript Drag & Drop library your grandparents warned you about.
Draggable is no longer maintained by its original authors. Maintenance of this repo has been passed on to new collaborators and is no longer worked on by anyone at Shopify.
We are still looking for more maintainers! If anyone is interested in answering / triaging issues, reviewing / rejecting / approving PRs, and authoring code for bug fixes / new features — please send an email to max.hoffmann (at) shopify (dot) com. You may be asked a few questions before obtaining collaboration permission, but if everything checks out, we will happily add you as a collaborator.
Get complete control over drag and drop behaviour with Draggable! Draggable abstracts
native browser events into a comprehensive API to create a custom drag and drop experience.
Draggable comes with additional modules: Sortable, Droppable, Swappable. Draggable
itself does not perform any sorting behaviour while dragging, but does the heavy lifting, e.g.
creates mirror, emits events, manages sensor events, makes elements draggable.
The additional modules are built on top of Draggable and therefore provide a similar API
interface, for more information read the documentation below.
Features
You can install the library via npm.
npm install @shopify/draggable --saveor via yarn:
yarn add @shopify/draggableor via CDN
…Check the "browserlist" property in package.json for more info
| Last 3 versions ✔ | Last 3 versions ✔ | Last 3 versions ✔ | Last 3 versions ✔ | Last 3 versions ✔ |
You can find the documentation for each module within their respective directories.
Draggable includes TypeScript definitions.
To run the examples project locally, simply run the following from the draggable root:
yarn && yarn startThis will start a server that hosts the contents of examples/. It also watches for file
changes from both src/ and examples/src and reloads the browser.
Contributions are more than welcome, the code base is still new and needs more love.
For more information, please checkout the contributing document.
Copyright (c) 2018-present Shopify. See LICENSE.md for further details.
Boa noite
Why Sensors trigger events in source container?
The mirror element created at the wrong place when using flexbox
Does it make sense to replace AbstractEvent with CustomEvent?
Sortable with fixed Layout
[BUG] - Multiple Container Sortable Bug on touch devices
Duplicate Mirror gets created on iOS Safari if the draggable element contains a link
Swappable:swap cancel async
Question - Sortable and Snappable
Draggable.Sortable on Table Rows Using rowspan