NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
npm · #2066 most downloaded on npm
Internal utilities to bee shared between `@dnd-kit` packages
Last release 3 years ago
no release in 18 months
Ships unpredictably
gaps range from 9 days to 10 months
Nearly every release is documented
notes for 13 of 13 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
87 releases · first in 2021
One column per quarter.
### Patch Changes - #1239 `f342d5e` Thanks @petdud! - Fix: getOwnerDocument should get correct document for SVG Elements
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
### Patch Changes - #948 `da7c60d` Thanks @Ayc0! - Upgrade to TypeScript to 4.8
Nothing published for this version
### Minor Changes - #748 `59ca82b` Thanks @clauderic! - Introduced the findFirstFocusableNode utility function that returns the first focusable node w
#748 59ca82b Thanks @clauderic! - Introduced the findFirstFocusableNode utility function that returns the first focusable node within a given HTMLElement, or the element itself if it is focusable.
#733 035021a Thanks @clauderic! - Introduced the useEvent hook based on implementation breakdown in the RFC. In the future, this hook will be used as a polyfill if the native React hook is unavailble.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
This new approach changes the frame of comparison to be relative to the viewport. This is a major breaking change, and will need to be released under…
#518 6310227 Thanks @clauderic! - Major internal refactor of measuring and collision detection.
Previously, all collision detection algorithms were relative to the top and left points of the document. While this approach worked in most situations, it broke down in a number of different use-cases, such as fixed position droppable containers and trying to drag between containers that had different scroll positions.
This new approach changes the frame of comparison to be relative to the viewport. This is a major breaking change, and will need to be released under a new major version bump.
@dnd-kit now ignores only the transforms applied to the draggable / droppable node itself, but considers all the transforms applied to its ancestors. This should provide the right balance of flexibility for most consumers.
ViewRect, LayoutRect to just a single concept of ClientRect.
ClientRect interface no longer holds the offsetTop and offsetLeft properties. For most use-cases, you can replace offsetTop with top and offsetLeft with left.@dnd-kit/core package with getClientRect:
getBoundingClientRectgetViewRectgetLayoutRectgetViewportLayoutRecttranslatedRect from the SensorContext interface. Replace usage with collisionRect.activeNodeClientRect on the DndContext interface. Replace with activeNodeRect.528c67e Thanks @clauderic! - Introduced the useLatestValue hook, which returns a ref that holds the latest value of a given argument. Optionally, the second argument can be used to customize the dependencies passed to the effect.
02edd26 Thanks @clauderic! - - The useNodeRef hook's onChange argument now receives both the current node and the previous node that were attached to the ref.
onChange argument is only called if the previous node differs from the current nodeNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
### Patch Changes - #532 `dfa8d69` Thanks @Nauss! - fix: isWindow has been updated to support checking wether an element is a window object in Electro
Nothing published for this version
Nothing published for this version
For example, checking if an element is an instance of an HTMLElement is normally done like so:
#509 1c6369e Thanks @clauderic! - Helpers have been updated to support rendering in foreign window contexts (via ReactDOM.render or ReactDOM.createPortal).
For example, checking if an element is an instance of an HTMLElement is normally done like so:
if (element instanceof HTMLElement)
However, when rendering in a different window, this can return false even if the element is indeed an HTMLElement, because this code is equivalent to:
if (element instanceof window.HTMLElement)
And in this case, the window of the element is different from the main execution context window, because we are rendering via a portal into another window.
This can be solved by finding the local window of the element:
const elementWindow = element.ownerDocument.defaultView;
if (element instanceof elementWindow.HTMLElement)
Nothing published for this version
Nothing published for this version
### Major Changes - #373 `1f5ca27` Thanks @clauderic! - Added react to peerDependencies of @dnd-kit/utilities ### Minor Changes - #334 `13be602` Thank
1f5ca27 Thanks @clauderic! - Added react to peerDependencies of @dnd-kit/utilities13be602 Thanks @trentmwillis! - Move Coordinates interface along with getEventCoordinates, isMouseEvent and isTouchEvent helpers to @dnd-kit/utilitiesNothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →