-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[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?) |
@@ -542,7 +542,7 @@ class Slider extends Component { | |||
|
|||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
style
and hence the width % was being applied twice.I removed the
style
parameter inobject.assign
as 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