react-horizontal-timeline icon indicating copy to clipboard operation
react-horizontal-timeline copied to clipboard

Prev/Next buttons for changing selection

Open DWMiller opened this issue 6 years ago • 3 comments

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 avatar Jul 03 '18 06:07 DWMiller

@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?

Nickman87 avatar Jul 03 '18 07:07 Nickman87

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)?

DWMiller avatar Jul 04 '18 05:07 DWMiller

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

Nickman87 avatar Jul 08 '18 16:07 Nickman87