react-archer
react-archer copied to clipboard
Improve elements registration handling
Cant't merge yet, something is wrong. E2E tests break on mount... (no arrows drawn at all)
This PR needs to be merged! It fixes a bug that I had since moving to React 18 and React-Archer 4.x! 🥳
In my project, I drag to connect two elements. While dragging, one end of the connection stays with the original element, and the other follows my mouse cursor. If I lift my mouse prematurely before, outside of another element, the "connection" aborts. The bug caused the connections to not disappear, even though no react-archer relation existed. Doesn't occur with this PR :)
I can't share a reproducable example sadly.
Cool, very glad to hear that!
Unfortunately, I am quite frightened by the E2E tests breaking 🤔 The mounting of the arrows is not instantaneous since this PR. It's invisible to the bare eye, but the tests catch this.
Can you wait longer? I guess you can fork with this PR merged 😊
Ah, yeah, broken tests are a valid reason not to merge yet. I can just use this branch for now (found out I can use urls to git branches as dependencies). As long as it gets merged sooner or later, all's good :)
Cool. Really glad to hear that this will improve the lib's stability. I was doing this for maintainability mostly, I'm glad to hear that this solves an actual problem :blush:
I'll try to get back to work on this!
Finally got to work on this and solve the problem! I will publish a new version soon :)