react-horizontal-timeline
react-horizontal-timeline copied to clipboard
Prev/Next buttons for changing selection
Is this possible? Having the buttons change the view is all well and good, but even better if it could be set to move the the selection as well.
@DWMiller This is currently not supported, but it wouldn't be to hard to expose the button handlers to support this kind of functionality. If you want you can make a pull request for it?
Might take a look on the weekend, what would say makes more sense, a prop to set true/false on the buttons scrolling the active value, or a function that would be called on scroll and provided with the new position (which you would use to update the value yourself)?
I think adding a function to call when the button is pressed provides the greatest flexibility do interact with the button presses in any way you want.
- Returning nothing or true would just scroll like it does now
- Returning a number will try to select that index
- Returning false would cancel any action