MrBlenny / react-flow-chart

🌊 A flexible, stateless, declarative flow chart library for react.
https://mrblenny.github.io/react-flow-chart/index.html
MIT License
1.46k stars 307 forks source link

Fix: Node size not updated when node size changed on DOM #71

Closed zetavg closed 4 years ago

zetavg commented 4 years ago

el.offsetWidth and el.offsetHeight should be checked against node.size.width and node.size.height (which comes from chartData) rather then size.width and size.height (which is the local state).

size.width and size.height is set by ResizeObserver, which will always be equal with el.offsetWidth and el.offsetHeight at this place, while this side effect being triggered by ResizeObserver.