Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The position of arrows is moved down unexpectedly when new node added to the list of nodes #134

Open
nathantqn opened this issue Apr 6, 2022 · 1 comment

Comments

@nathantqn
Copy link

nathantqn commented Apr 6, 2022

Describe the bug & Expected behavior
When I add new item to a vertical list of items, the position of arrow is moved down unexpectedly. I also tried to use the useArrows hook to call the updateArrow function to make it recalculate but it doesn't work.

To Reproduce
Here is an example I created on Codesandbox: https://codesandbox.io/s/react-xarrows-bug-qbhniy?file=/src/examplesFiles/Example4.jsx.

You can see when I click on the Add More button, the arrow keeps going down although the position of hello-1 and hello-2 components are not changed.

I tried to change the vertical list to horizontal list and the issue will be disappeared. But currently I need to handle the vertical list so could you please help me to check, thank you!

Screenshots
image

image

@nathantqn nathantqn changed the title The position of arrows is not updated when new node added to the list The position of arrows is moved down unexpectedly when new node added to the list of nodes Apr 6, 2022
@harishv7
Copy link

Hi, I am facing a similar issue where the arrows are not rendering properly. Essentially, the arrows are misplaced, moved down whenever a new node is added.

However, when I scroll the page, the arrows are re-rendered correctly. Could you please help check the issue of re-rendering the arrows. I am not sure if it is rendering at the same time React is rendering the components or something like that. I have already tried calling the updateArrows hook under useEffect, but it doesn't help.

Appreciate your help on this please!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants