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 />) in onBeforeCapture with some items (<Draggable />) in it to show off the kind of thing you can do โ™ป๏ธ

    before-on-capture-2 2019-11-14 16_48_03

    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 existing lighthouse build
    • ๐Ÿ›  Fixing typo in our reparenting pattern. Thanks @TrySound for raising it

    ๐Ÿ›  > These fixes resulted in a patch version bump (which got eaten by the minor version bump)