- Due to API changes, this is a major release.
Breaking Changes:
- Both
<DraggableCore>
and<Draggable>
have had their callback types changed and unified.
type DraggableEventHandler = (e: Event, data: DraggableData) => void | false;
type DraggableData = {
node: HTMLElement,
// lastX + deltaX === x
x: number, y: number,
deltaX: number, deltaY: number,
lastX: number, lastY: number
};
- The
start
option has been renamed todefaultPosition
. - The
zIndex
option has been removed.
Possibly Breaking Changes:
- When determining deltas, we now use a new method that checks the delta against the Draggable's
offsetParent
.
This method allows us to support arbitrary nested scrollable ancestors without scroll handlers!- This may cause issues in certain layouts. If you find one, please open an issue.
Enhancements:
<Draggable>
now has aposition
attribute. Its relationship todefaultPosition
is much like
value
todefaultValue
on React<input>
nodes. If set, the position is fixed and cannot be mutated.
If empty, the component will manage its own state. See #140
for more info & motivations.- Misc. bugfixes.