uber / react-digraph

A library for creating directed graph editors
MIT License
2.63k stars 268 forks source link

[Bug fix] selected edge doesn't reflect properly #352

Closed chenyunw-uber closed 1 year ago

chenyunw-uber commented 1 year ago

When selecting an edgeA and then edgeB, edgeA is still highlighted but not edgeB. However, internal props and state already update. It's because when we call requestAnimationFrame which causes a delay. To fix that, we add forceUpdate whenever there is a selection change.

https://github.com/uber/react-digraph/assets/93685999/c71a4f4e-d6f9-43e9-b694-e1835fdd7f68