uber / react-digraph

A library for creating directed graph editors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Edge creation behavior changes depending on whether shift is released during drag

ksnyder9801 opened this issue · comments

Describe the bug
Releasing shift during an "edge creation" drag without releasing the mouse button breaks a couple things.

  • The target position of the edge is now affected by the LayoutEngine
  • onCreateEdge is never called, so you cannot create the edge this way

To Reproduce
Steps to reproduce the behavior:

  1. Use SnapToGrid layout engine
  2. Begin an edge drag operation (shift+drag starting on a node) and release shift during the drag without releasing the mouse button
  3. Observe position snapping and lack of edge creation

Expected behavior
Edge target position should not snap to the grid. Edge should be created regardless of the order of keyUp/mouseUp when ending a drag.

Additional context
Regression probably introduced around PR#283