react-dnd / react-dnd

Drag and Drop for React

Home Page:http://react-dnd.github.io/react-dnd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature request: api to get modifier keys when drag starts

jedwards1211 opened this issue · comments

Is your feature request related to a problem? Please describe.

I'm implementing a tree where one or more nodes can be dragged and dropped.
In a typical tree UI, when you start dragging a node, other selected nodes are included in the drag if you're pressing Ctrl or Command etc, but otherwise only the node you pressed on is included.
There's not a straightforward way to accomplish this with react-dnd yet.

Describe the solution you'd like

I think the backend should pass modifier keys through to react-dnd, and DragSourceMonitor should have a getter for the modifier keys.

Describe alternatives you've considered

Right now I'll have to do something kludgey like add my own additional drag event listener and save the modifier keys from that.

Additional context