react-range
react-range copied to clipboard
Direction.Down and arrow keys
Hi! In the Down direction example the down arrow key goes up and the up arrow key goes down. Is that intentional?
It is intentional according to the spec.
Down Arrow: Decrease the value of the slider by one step.
Although, there is a note:
some circumstances, reversing the direction of the value change for the keys specified above, e.g., having Up Arrow decrease the value, could create a more intuitive experience.
Not sure if it's worth to introduce the breaking change now.
Hm 🤔, I interpret that the circumstances from the note are exactly the cases where you use Direction.Down. I find the current behavior very counterintuitive.
I understand if a breaking change is not worth it, and if adding yet another flag just for this case is too much.
Maybe something more general, like a way to override the INCREASE_KEYS and DECREASE_KEYS?
maybe rather revertKeys={true} ?
maybe rather
revertKeys={true}?
would that revert all keys? or just vertical keys?
Another option is to add a new Direction
Hm, it gets more complicated because there is a left direction and also all 4 directions can be flipped with dir=rtl.
Also, when using horizontal (left/right) directions should ArrowUp always increase/decrease the value? What is intuitive there? There is also PageUp/PageDown.
I guess my idea is that revertKeys would flip ArrowUp/Down for vertical directions and ArrowLeft/Right for horizontal...