Description
Is your feature request related to a problem? Please describe.
Sometimes it would be nice if the activeItemIndex
would not only select the active timeline item only on load but could also be controlled (like in a controlled component) later. For instance for using custom prev / next buttons to jump to a certain timeline item. Or setting the active item by some other kind of app state.
Describe the solution you'd like
Since activeItemIndex
is unready set to be only used "on load", maybe add another prop like controlledActiveItemIndex
. In the end - looking at the code for
react-chrono/src/components/index.tsx
Lines 119 to 126 in 750a314
handleTimelineUpdate(newTimeLineItem)
and setActiveTimelineItem(newTimeLineItem)
Describe alternatives you've considered
I looked into a way how maybe handleTimelineUpdate(newTimeLineItem)
and setActiveTimelineItem(newTimeLineItem)
could be called from outside, but did not find a way. Both functions do not seem to be exposed. Actually, just exposing handleTimelineUpdate(newTimeLineItem)
would probably be sufficient as it internally calls setActiveTimelineItem(newTimeLineItem)
itself:
react-chrono/src/components/index.tsx
Lines 84 to 99 in 750a314
Additional context
Add any other context or screenshots about the feature request here.