react-draggable v2.0.0-beta1 Release Notes

Release Date: 2016-04-14 // almost 8 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
    };
    
    • 0️⃣ 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:

    • 0️⃣ <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.