Skip to content

Commit

Permalink
[Slider] fix transitions (mui#12531)
Browse files Browse the repository at this point in the history
Fixes track behavior when slider was focused and values
were changed via arrow keys. The track used to outspace
the thumb.
  • Loading branch information
eps1lon authored and marcelpanse committed Oct 2, 2018
1 parent c055eed commit 36d36d1
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions packages/material-ui-lab/src/Slider/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ export const styles = theme => {
easing: theme.transitions.easing.easeOut,
};

const commonTransitionsProperty = ['width', 'height', 'box-shadow', 'left', 'top'];

const commonTransitions = theme.transitions.create(
commonTransitionsProperty,
['width', 'height', 'left', 'top', 'box-shadow'],
commonTransitionsOptions,
);
// no transition on the position
const thumbActivatedTransitions = theme.transitions.create(
['width', 'height', 'box-shadow'],
commonTransitionsOptions,
);

Expand Down Expand Up @@ -62,7 +65,7 @@ export const styles = theme => {
top: '50%',
height: 2,
backgroundColor: colors.primary,
'&$focused, &$activated': {
'&$activated': {
transition: 'none',
},
'&$disabled': {
Expand Down Expand Up @@ -106,7 +109,7 @@ export const styles = theme => {
'&$activated': {
width: 17,
height: 17,
transition: 'none',
transition: thumbActivatedTransitions,
},
'&$disabled': {
cursor: 'no-drop',
Expand Down

0 comments on commit 36d36d1

Please sign in to comment.