Beautiful and accessible drag and drop for lists with React
DragDropContext
#720. Thanks @faiwer for finding this one, and for the great issue detail!flow
type for DragDropContext > hook
functions #695. Thanks @kylehalleman!!!button
) as drag handles. #704 Thanks @kylehalleman!DragDropContext > hook
functions now allow you to return a value from your hook function if you want. However, we do not do anything with these returned values. This is also called out in the docs #695
- type OnBeforeDragStartHook = (start: DragStart) => void;
- type OnDragStartHook = (start: DragStart, provided: HookProvided) => void;
- type OnDragUpdateHook = (update: DragUpdate, provided: HookProvided) => void;
- type OnDragEndHook = (result: DropResult, provided: HookProvided) => void;
+ type OnBeforeDragStartHook = (start: DragStart) => mixed;
+ type OnDragStartHook = (start: DragStart, provided: HookProvided) => mixed;
+ type OnDragUpdateHook = (update: DragUpdate, provided: HookProvided) => mixed;
+ type OnDragEndHook = (result: DropResult, provided: HookProvided) => mixed;
onDragStart
: Getting the timing rightSummary: we have made the timings of the
DragDropContext > Hook
functions more consistent, created a new hook:onBeforeDragStart
and created a guide for hooks
We keep having timing issues popping up relating to onDragStart
. It can break some use cases if it is called before we update the Draggable
and Droppable
components, and it can break some use cases if it is called after. Rather than trying to make onDragStart
work for both cases we have created a new hook: onBeforeDragStart
.
onDragStart
, onDragUpdate
and onDragEnd
are now called consistantly after the Draggable
and Droppable
components have been updated. If you need to do some work just before Draggable
and Droppable
components have their initial snapshot
values updated, then you can use onBeforeDragUpdate
.
We have created a guide for hooks which explains all of the hooks in detail and the timings in which the hooks are called.
This is a breaking change 💥. It has been listed as a breaking change as it will break consumers who are following our dimension locking table reordering strategry.
flow
0.78
#686babel
#687. Thanks @TrySoundgreenkeeper
lock file updates #684. Thanks @MarshallOfSoundprop-types
#681.We have created a free course on egghead.io
to help people get started with react-beautiful-dnd
as quickly as possible. Even if you have been using react-beautiful-dnd
for a while, you may still learn something new - especially in the later lessons
flow
v0.77
#673TypeScript
example to the README.md
#666. Thanks @abeaudoin2013!DragDropContext > onDragStart
hook is now called before the first render of a Draggable
or Droppable
during a drag #676. This fixes usages of dimension locking for table reordering. This restores the timing behaviour of 7.x
redux
v4.0
flowtyped
definitions #650. This was causing issues for users of redux
with v4.0
defintions. Thanks for raising this @chmanie!chrome: headless
and firefox: headless
which is pretty awesome 🎸. Thanks @RajaBellebon and @MarshallOfSound for getting this added.yarn.lock
files are checked in #655. Thanks @MarshallOfSoundobject-rest-spread
plugin from dev dependencies #635. Thanks @TrySoundjsdom
(such as the one that ships in create-react-app
the SVGElement
constructor does not exist. Running the check el instanceof SVGElement
would cause an exception. We are now more defensive in our usage of the SVGElement
constructor #641raf-schd
to the latest version #643Droppable
then a user would be unable to auto scroll backwards through the list. Scrollbars, am I right? Anyway, we now account for this #628. Thanks @SimchaShats for raising this oneinvariant
condition which was preventing dynamic updates to Droppable > isDropDisabled
#617. Thanks @ntelkedzhiev for your persistance with this oneprettier
#629Draggable
to save about 20 lines 😊 #627drag-handle.spec.js
file into lots of spec files #627babel
and rollup
#624. Thanks @TrySound!puppeteer
browser test to non-headless with xvfb
to reduce build flakes #630. Thanks @MarshallOfSound!!<svg>
elements #613If you are attempting to use a <svg>
(a SVGElement
) as a Draggable
or drag handle react-beautiful-dnd
will now give you a more helpful error messaging in development builds. We have also created a dragging <svg>
s guide to help you with dragging SVGs if you want to.
Thanks for raising this @mikesobol
DragDropContext > Hooks
timing issue #618. Thanks for raising it @ntelkedzhiev