Skip to content

Commit

Permalink
increaseKey and decreaseKey
Browse files Browse the repository at this point in the history
  • Loading branch information
Weslen Nascimento committed Apr 30, 2020
1 parent 8fd2b89 commit d169f16
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/material-ui/src/Slider/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -434,8 +434,8 @@ const Slider = React.forwardRef(function Slider(props, ref) {
const marksValues = marks.map((mark) => mark.value);
const marksIndex = marksValues.indexOf(value);
let newValue;
const ArrowRight = isRtl ? 'ArrowLeft' : 'ArrowRight';
const ArrowLeft = isRtl ? 'ArrowRight' : 'ArrowLeft';
const increaseKey = isRtl ? 'ArrowLeft' : 'ArrowRight';
const decreaseKey = isRtl ? 'ArrowRight' : 'ArrowLeft';

switch (event.key) {
case 'Home':
Expand All @@ -454,15 +454,15 @@ const Slider = React.forwardRef(function Slider(props, ref) {
newValue = value - tenPercents;
}
break;
case ArrowRight:
case increaseKey:
case 'ArrowUp':
if (step) {
newValue = value + step;
} else {
newValue = marksValues[marksIndex + 1] || marksValues[marksValues.length - 1];
}
break;
case ArrowLeft:
case decreaseKey:
case 'ArrowDown':
if (step) {
newValue = value - step;
Expand Down

0 comments on commit d169f16

Please sign in to comment.