- [ BREAKING ] Update to
rescript@11
.
- [ BREAKING ] Update to
rescript@10
. - [ BREAKING ] Replace
bs-webapi
withrescript-webapi
.
- [ BREAKING ] Switch to
@rescript/react
. - [ BREAKING ] Update
bs-platform
.
- [ BREAKING ] Replace
bs-log
withres-logger
. - [ BREAKING ] Move
bs-webapi
to peer dependensies.
- [ BREAKING ] Modules of
DndEntry
type must providecmp
function to avoid polymorphic comparison. See this diff for details. - [ BREAKING ] Minimum required version of
bs-platform
is7.1.1
. - [ BREAKING ] Minimum required version of
reason-react
is0.8.0
.
bs-platform
updated tov7
.bs-log
updated tov1
.
- Added
onDragStart
,onDropStart
&onDropEnd
handlers.
- Full rewrite using hooks api.
Features
- Horizontal lists support.
Features
- Scrollable containers support.
Features
- Auto-scroll at the vertical edges of the window.
Fixes
- Fix sorting for case when draggable that being dragged is way bigger or smaller than siblings.
- Fix determination of a landing point when dropping on empty droppable with header.
Features
- Conditional drag & drop. Now each
Droppable
takes optionalaccept
prop:
~accept: option(Draggable.t => bool)=?
<Dnd.Droppable
accept=(
fun
| Todo => true
| TodoList => false
)
/>
- Custom drag handles.
/* Without custom drag handle */
<Dnd.Draggable>
...(Children("Drag me" |> ReasonReact.string))
</Dnd.Draggable>
/* With custom drag handle */
<Dnd.Draggable>
...(
ChildrenWithHandle(
handle =>
<button
style=handle.style
onMouseDown=handle.onMouseDown
onTouchStart=handle.onTouchStart
>
("Drag me" |> ReasonReact.string)
</button>
)
)
</Dnd.Draggable>
API
- [ BREAKING ]
Config
updated: structure is changed andeq
function is required for both typesDraggable.t
andDroppable.t
. It should improve overall perf.
- module type Config = {
- type draggableId;
- type droppableId;
- };
+ module type Config = {
+ module Draggable: {
+ type t;
+ let eq: (t, t) => bool;
+ };
+
+ module Droppable: {
+ type t;
+ let eq: (t, t) => bool;
+ };
+ };
- [ BREAKING ]
Droppable
's 'className
function receives~draggingOver: bool
instead of~draggingOver: option('droppableId)
(by virtue of the first change).
- type className = (~draggingOver: option('droppableId)) => string;
+ type className = (~draggingOver: bool) => string;
Improvements
- Don't interrupt text selection on desktops.
- Disable text selection on drag in Safari.
Features
- Add touch interactions support.
- Make
className
prop a function (Draggable
&Droppable
).
- Core architecture.
Features
- Vertical lists.
- Multiple drop targets.