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 step & max issue #6752

Merged
merged 1 commit into from May 2, 2017
Merged

[Slider] Fix step & max issue #6752

merged 1 commit into from May 2, 2017

Conversation

omarchehab98
Copy link

Closes #6750, if the last step is less than half the step size, due to the rounding in the formula to calculate the value in setValueFromPosition it is impossible to fill the slider. I resolved this issue by setting the value to the min/max if the cursor is past the respective edges.

  • PR has tests/docs demo and is linted.

I did not write new tests because the problem is specifically related to dragging. Currently, the Slider unit tests do not cover mouse actions, I am not experienced enough to write such tests. However, I did test it manually.

  • 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).

Closes #6750, if the last step is less than half the step size, due to the rounding in the formula to calculate the value in `setValueFromPosition` it is impossible to fill the slider. I resolved this issue by setting the `value` to the `min`/`max` if the cursor is past the respective edges.
@oliviertassinari oliviertassinari added component: slider This is the name of the generic UI component, not the React module! bug 🐛 Something doesn't work labels May 2, 2017
@oliviertassinari oliviertassinari changed the title [Slider] Fixed dragging bug [Slider] Fix step & max issue May 2, 2017
@oliviertassinari oliviertassinari merged commit 72a0f07 into mui:master May 2, 2017
@oliviertassinari
Copy link
Member

@omarchehab98 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work 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.

None yet

3 participants