HTML 5 Native Drag and Drop #306
-
Hi, I read the README and it mentioned that dnd-kit doesn't implement HTML 5 Native Drag and Drop. I wonder what the are the reasons behind not implementing it? is it possible to support it and what do we need to do if we want to have it? Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@dnd-kit is intentionally not built on the HTML5 Drag and Drop API because it has severe limitations. It does not support touch devices or using the keyboard to drag items, which means that the libraries that are built on top of it need to expose an entirely different implementation to support those input methods. This typically increases the complexity of the codebase and the overall bundle size of the library, and leads to inconsistencies between the mouse, touch and keyboard layers because they're powered by entirely different implementations. The HTML5 Drag and Drop API is also limiting; it doesn't support common use-cases such as locking dragging to a specific axis or to the bounds of a container, custom collision detection strategies, or even customizing the preview of the dragged item. The main tradeoff with not using the HTML5 Drag and drop API is that you won't be able to drag from the desktop or between windows. If the drag and drop use-case you have in mind involves this kind of functionality, you'll definitely want to use a library that's built on top of the HTML 5 Drag and drop API. |
Beta Was this translation helpful? Give feedback.
@dnd-kit is intentionally not built on the HTML5 Drag and Drop API because it has severe limitations.
It does not support touch devices or using the keyboard to drag items, which means that the libraries that are built on top of it need to expose an entirely different implementation to support those input methods.
This typically increases the complexity of the codebase and the overall bundle size of the library, and leads to inconsistencies between the mouse, touch and keyboard layers because they're powered by entirely different implementations.
The HTML5 Drag and Drop API is also limiting; it doesn't support common use-cases such as locking dragging to a specific axis or to the bounds o…