Skip to content

Drag tracking #846

@shahankit

Description

@shahankit

I'm implementing a simple match the following options kind of UI.
screen shot 2017-08-12 at 6 36 27 pm

I wrapped the the list component in DragDropContext using HTML5Backend. I defined the left side circles as DragSource and right side circles as DropTarget. For the DragSource nodes I defined collect function to return isDragging and getClientOffset from monitor:

function collect(connect, monitor) {
  return {
    ...
    isDragging: monitor.isDragging(),
    clientOffset: monitor.getClientOffset(),
  };
}

The render function of my DragSource node is not called when I start dragging. I want to draw a line between the dragSource and the current drag mouse position and hence need to track the current drag position. I'm new to react-dnd, any help on how to implement this would be great.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions