justin-chu / react-fast-marquee

A lightweight React component that harnesses the power of CSS animations to create silky smooth marquees.
https://react-fast-marquee.com
MIT License
1.16k stars 95 forks source link

Recalculate Speed when children change #61

Closed sj3-at-roke closed 1 year ago

sj3-at-roke commented 1 year ago

I believe this fixes:

9

and

18

calculate width was only calculated on first render, and so change in the width of the children (for example, if the number of items in an array that is mapped into the \ changes) caused the items to move far too fast or slow.

I believe this also may fix the issue where there is a large gap between the last item and the next repeat of the first item. It does not fix this issue.

@justin-chu

justin-chu commented 1 year ago

I don't believe this will solve those issues since it doesn't seem like they're updating the children. However, this is still a good addition for dynamic content. Thanks!