react-archer icon indicating copy to clipboard operation
react-archer copied to clipboard

Improve elements registration handling

Open pierpo opened this issue 2 years ago • 3 comments

pierpo avatar Jul 29 '22 21:07 pierpo

Cant't merge yet, something is wrong. E2E tests break on mount... (no arrows drawn at all)

pierpo avatar Aug 11 '22 00:08 pierpo

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.

Andonvr avatar Sep 14 '22 14:09 Andonvr

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 😊

pierpo avatar Sep 14 '22 16:09 pierpo

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 :)

Andonvr avatar Sep 16 '22 22:09 Andonvr

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!

pierpo avatar Sep 16 '22 23:09 pierpo

Finally got to work on this and solve the problem! I will publish a new version soon :)

pierpo avatar Nov 03 '22 22:11 pierpo