Open Himanshupal0001 opened 2 years ago
Before
After
I can reproduce this by passing a React state variable to the groups. However, if I pass a normal array then it works as expected.
I have the same problem on Mozilla, but it does not appear on Google Chrome or Safari.
I have the same problem on Mozilla, but it does not appear on Google Chrome or Safari.
I tried in all the browsers and the issue still persist.
I can reproduce this by passing a React state variable to the groups. However, if I pass a normal array then it works as expected.
Yeah, If A normal array is passed it works fine {if the value provided already rather fetched from the backend}. Do you have any idea how to resolve this? I tried normal arrays rather than states but the issue still persists.
what does a normal array mean? I have this bug even with demo example. anyone know how to resolve it?
After spending an afternoon with this issue I have found that the issue occurrs when groups/items is undefined
such as you might get if using useState before it is set.
To fix this I changed my code to check if groups and items are set before rendering:
{groups && items &&
<Timeline
groups={groups}
items={items}
...
/>
}
More detail:
This seems to be a bug in the ScrollElement with thescrollComponent.scrollLeft
being 0 initially until after the Timeline is resized.
Describe the bug A clear and concise description of what the bug is.
To Reproduce
Please provide one or both of the following:
Code (If you have a branch somewhere that shows your issue) or link to codesandbox example. Here's a base template for this library:
OR
Steps to reproduce the behavior:
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help explain your problem.
Library Version Please provide version of library in which this bug is occurring.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context Add any other context about the problem here.