namespace-ee / react-calendar-timeline

A modern and responsive react timeline component.
MIT License
1.91k stars 613 forks source link

Horizontal scroll breaks after manipulating groups/items #882

Open Front-start opened 1 year ago

Front-start commented 1 year ago

Describe the bug I have implemented a group filter. After I filter all groups and then reset the filter, horizontal scroll to the right starts working as scroll to the left.

To Reproduce

Steps to reproduce the behavior:

  1. Go to codebox
  2. Wait for 6 seconds
  3. Scroll right

Expected behavior Date goes up

Library Version 0.28.0

franciscohanna92 commented 1 year ago

I found a hack to solve it: Force a re-render of the whole thing after altering groups/items.

This could be achieved by passing a prop key={this.state.timelineKey} to <Timeline /> and set that state property to something new each time you change the items or groups (i.e. this.setState({...this.state, timelineKey: Date.now()}))

fpaupier commented 1 year ago

Thanks so much @franciscohanna92. Your workaround solved a similar issue I was facing.