Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Slider/Slider.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,10 @@ class Slider extends Component {
* Whether or not the slider is required in a form.
*/
required: PropTypes.bool,
/**
* Override the inline-styles of the inner slider element.
*/
sliderStyle: PropTypes.object,
/**
* The granularity the slider can step through values.
*/
Expand All @@ -232,6 +236,7 @@ class Slider extends Component {
max: 1,
min: 0,
required: true,
sliderStyle: {},
step: 0.01,
style: {},
};
Expand Down Expand Up @@ -542,7 +547,7 @@ class Slider extends Component {

const {prepareStyles} = this.context.muiTheme;
const styles = getStyles(this.props, this.context, this.state);
const sliderStyles = styles.slider;
const sliderStyles = Object.assign(styles.slider, this.props.sliderStyle);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we destructure the sliderStyle from this.props? That would prevent it from beeing applied to the root element.


let handleStyles = {};
let percent = this.state.percent;
Expand Down