github react-grid-layout/react-draggable v2.0.0-beta1
2.0.0-beta1

latest releases: v4.4.6, v4.4.5, v4.4.4...
7 years ago
  • 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 to defaultPosition.
  • 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 a position attribute. Its relationship to defaultPosition is much like
    value to defaultValue 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.

Don't miss a new react-draggable release

NewReleases is sending notifications on new releases.