[Slider] Fix Slider div style#4087
Conversation
|
This PR is introducing a breaking change. Do we want to wait for |
|
I don't mind anything here. I would like @nathanmarks and @mbrookes to comment. |
|
@oliviertassinari - I agree with you that this is a bug, but potentially a breaking change to remove style from slider. How useful might it be to be able to style the slider at this level rather than the root div? (i.e. how likely is it someone is depending on the style prop being removed here?) |
| const {prepareStyles} = this.context.muiTheme; | ||
| const styles = getStyles(this.props, this.context, this.state); | ||
| const sliderStyles = Object.assign({}, styles.root, style); | ||
| const sliderStyles = Object.assign({}, styles.slider); |
There was a problem hiding this comment.
Object.assign is no longer useful.
I would say the probability is low and I would consider this a bug before all. @tintin1343 Could you have a look at my comment? It would be good to merge this PR before releasing |
|
@oliviertassinari : Sorry for the delay, was out of action for a couple days. I will get back to you on this. |
|
@oliviertassinari : I remove |
|
@tintin1343 That looks good to me. Could you squash? |
169518c to
f124dec
Compare
|
@oliviertassinari : Done. |
|
Well, I was depending on the style prop for the Slider. Why is the default bottom margin 48px? That's seems ridiculously large, that's all I was trying to change. Great work project BTW! |
I would even go further. Why do we have a default margin?
We have many customization points on the others components. You could submit a PR to add a |
Resolves: #3282
The issue with the current slider style was that it used to apply styles twice because of the prepareStyles including
styleand hence the width % was being applied twice.I removed the
styleparameter inobject.assignas that was the reason of including the styles twice.So the style will be applied only once to the Slider div. Renamed styles.root to style.slider