react-beautiful-dnd v12.1.0 Release Notes
Release Date: 2019-11-14 // over 4 years ago-
๐ New
onBeforeCapture
responder #1588<DragDropContext /> | onBeforeCapture
is called after we know a drag will start, but before any dimensions have been collected from the DOM. It is an opportunity to add or remove<Draggable />
and<Droppable />
components, or modify element sizes.๐ฑ > โ ๏ธ Warning: this is pretty powerful and it can be used to do great things, as well as terrible things.
๐ For more details, check out our responders guide
In the following example, I am adding a trash bin (
<Droppable />
) inonBeforeCapture
with some items (<Draggable />
) in it to show off the kind of thing you can do โป๏ธResponder lifecycle+ 1. `onBeforeCapture`: a drag is about to start and dimensions have \*\*not been collected\*\* from the DOM2. `onBeforeDragStart`: a drag is about to start and dimensions \*\*have been captured\*\* from the DOM 3. `onDragStart`: A drag has started 4. `onDragUpdate`: Something has changed during a drag 5. `onDragEnd` \*\*(required)\*\*: A drag has ended. It is the responsibility of this responder to synchronously apply changes that has resulted from the drag
This change resulted in a
minor
version bump๐ Fixes
- ๐ Fixing issue with announcer and hot module reloading #1584. Thanks @Mangatt for raising this one โค๏ธ
- ๐ Improving the accessibility of lift instructions #1568. Thanks @flacerdk for finding this and @seancurtis for the fix! @seancurtis went the extra mile and also created a
jest-axe
help us have even better accessibility coverage. It seems to pick up a bit more than our existinglighthouse
build - ๐ Fixing typo in our reparenting pattern. Thanks @TrySound for raising it
๐ > These fixes resulted in a
patch
version bump (which got eaten by theminor
version bump)