Releases: clauderic/dnd-kit
@dnd-kit/[email protected]
@dnd-kit/[email protected]
Minor Changes
68960c4
#295 Thanks @akhmadullin! -@dnd-kit/core
is now apeerDependency
rather than adependency
for other@dnd-kit
packages that depend on it, such as@dnd-kit/sortable
and@dnd-kit/modifiers
. This is done to avoid issues with multiple versions of@dnd-kit/core
being installed by some package managers such as Yarn 2.
Patch Changes
- Updated dependencies [
ae398de
,8b938ce
]:- @dnd-kit/[email protected]
@dnd-kit/[email protected]
Minor Changes
68960c4
#295 Thanks @akhmadullin! -@dnd-kit/core
is now apeerDependency
rather than adependency
for other@dnd-kit
packages that depend on it, such as@dnd-kit/sortable
and@dnd-kit/modifiers
. This is done to avoid issues with multiple versions of@dnd-kit/core
being installed by some package managers such as Yarn 2.
Patch Changes
- Updated dependencies [
ae398de
,8b938ce
]:- @dnd-kit/[email protected]
@dnd-kit/[email protected]
Patch Changes
-
ae398de
Thanks @clauderic! - Allow setting an optionalid
prop onDndContext
to fix a warning during server-side rendering (especially in Next.js). By default, thisid
is autogenerated and can lead to a mismatch between the server- and client-side rendered HTML. We also avoid this mismatch by rendering theAccessibility
component only after everything else was initially mounted on the client. -
8b938ce
Thanks @clauderic! - Hide the node in the overlay after the drop animation is finished. This prevents some flickering with React concurrent mode.
@dnd-kit/[email protected]
@dnd-kit/[email protected]
@dnd-kit/[email protected]
Patch Changes
f9ec28f
#217 Thanks @clauderic! - Fixes a regression introduced with@dnd-kit/[email protected]
that was causeing sensors to stop working after a drag operation where activation constraints were not met.
@dnd-kit/[email protected]
Major Changes
-
a9d92cf
#174 Thanks @clauderic! - Distributed assets now only target modern browsers. Browserlist config:defaults last 2 version not IE 11 not dead
If you need to support older browsers, include the appropriate polyfills in your project's build process.
@dnd-kit/[email protected]
Patch Changes
-
a178857
#214 Thanks @clauderic! - Ensure that consumer defined data passed touseSortable
is passed down to bothuseDraggable
anduseDroppable
.The
data
object that is passed touseDraggable
anduseDroppable
withinuseSortable
also contains thesortable
property, which holds a reference to the index of the item, along with thecontainerId
and theitems
of its parentSortableContext
.
@dnd-kit/[email protected]
Major Changes
-
a9d92cf
#174 Thanks @clauderic! - Distributed assets now only target modern browsers. Browserlist config:defaults last 2 version not IE 11 not dead
If you need to support older browsers, include the appropriate polyfills in your project's build process.
Minor Changes
-
b7355d1
#207 Thanks @clauderic! - Thedata
argument foruseDraggable
anduseDroppable
is now exposed in event handlers and on theactive
andover
objects.Example usage:
import {DndContext, useDraggable, useDroppable} from '@dnd-kit/core'; function Draggable() { const {attributes, listeners, setNodeRef, transform} = useDraggable({ id: 'draggable', data: { type: 'type1', }, }); /* ... */ } function Droppable() { const {setNodeRef} = useDroppable({ id: 'droppable', data: { accepts: ['type1', 'type2'], }, }); /* ... */ } function App() { return ( <DndContext onDragEnd={({active, over}) => { if (over?.data.current.accepts.includes(active.data.current.type)) { // do stuff } }} /> ); }
Patch Changes
-
fb2db94
#212 Thanks @clauderic! - Allow consumers ofSortableContext
to provide items of shape{id: string}[]
orstring[]
-
Updated dependencies [
b7355d1
,a9d92cf
,b406cb9
]:- @dnd-kit/[email protected]
- @dnd-kit/[email protected]