Skip to content
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

Merged
merged 1 commit into from
May 2, 2016
Merged

Conversation

tintin1343
Copy link
Contributor

  • PR has tests / docs demo, and is linted.
  • Commit and PR titles begin with [ComponentName], and are in imperative form: "[Component] Fix leaky abstraction".
  • Description explains the issue / use-case resolved, and auto-closes the related issue(s) (http://tr.im/vFqem).

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 in object.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

@oliviertassinari
Copy link
Member

oliviertassinari commented Apr 28, 2016

This PR is introducing a breaking change. Do we want to wait for v0.16?
Or we could consider that the behavior was already broken end it's not a breaking change.

@tintin1343
Copy link
Contributor Author

I don't mind anything here. I would like @nathanmarks and @mbrookes to comment.

@mbrookes
Copy link
Member

mbrookes commented Apr 28, 2016

@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);
Copy link
Member

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.

@oliviertassinari
Copy link
Member

oliviertassinari commented Apr 30, 2016

how likely is it someone is depending on the style prop being removed here?

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 v0.15.0.

@oliviertassinari oliviertassinari added PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI and removed PR: Needs Review labels Apr 30, 2016
@tintin1343
Copy link
Contributor Author

@oliviertassinari : Sorry for the delay, was out of action for a couple days. I will get back to you on this.

@tintin1343
Copy link
Contributor Author

@oliviertassinari : I remove Object.assign() . Do Check it.

@oliviertassinari
Copy link
Member

@tintin1343 That looks good to me. Could you squash?

@tintin1343 tintin1343 added PR: Needs Review and removed PR: needs revision The pull request can't be merged. More details is available on the code review or fails in the CI labels May 2, 2016
@tintin1343
Copy link
Contributor Author

@oliviertassinari : Done.

@sghall
Copy link
Contributor

sghall commented May 13, 2016

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!

@oliviertassinari
Copy link
Member

oliviertassinari commented May 13, 2016

Why is the default bottom margin 48px?

I would even go further. Why do we have a default margin?

Well, I was depending on the style prop for the Slider.

We have many customization points on the others components. You could submit a PR to add a sliderStyle property.

@zannager zannager added the component: slider This is the name of the generic UI component, not the React module! label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: slider This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Slider] Unexpected result when set style.width to %-value
5 participants