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 not working correctly when min prop has decimals #34020

Closed
1 task
aleksey-10 opened this issue Feb 11, 2022 · 1 comment
Closed
1 task

Slider not working correctly when min prop has decimals #34020

aleksey-10 opened this issue Feb 11, 2022 · 1 comment
Assignees
Labels
🐛 Bug Ant Design Team had proved that this is a bug. 🎱 Collaborate PR only Need confirm with Designer or Core member

Comments

@aleksey-10
Copy link

  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

  1. Create a slider component with props min={0.05} max={2} step={1}
  2. Try moving the slider

What is expected?

It should be possible to reach the max value while dragging

What is actually happening?

  • Impossible to set the value to the max, it doesn't move further than 1
  • The minimum value sets to 0, should be 0.05.
Environment Info
antd 4.18.6
React 17.0.2
System Windows 10
Browser Chrome/98.0.4758.82
@aleksey-10 aleksey-10 changed the title Slider not working when min prop has decimals Slider not working correctly when min prop has decimals Feb 11, 2022
@dotamir
Copy link

dotamir commented Feb 12, 2022

@aleksey-10 Well this is because you set the step property to 1. That is the cause it doesn't work properly. If you expect the value to be 0.05 you need to set step to 0.05 not 1.

@afc163 afc163 added the 🐛 Bug Ant Design Team had proved that this is a bug. label Feb 14, 2022
@zombieJ zombieJ self-assigned this Feb 18, 2022
@xrkffgg xrkffgg added the 🎱 Collaborate PR only Need confirm with Designer or Core member label Feb 18, 2022
@zombieJ zombieJ closed this as completed Mar 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 Bug Ant Design Team had proved that this is a bug. 🎱 Collaborate PR only Need confirm with Designer or Core member
Projects
None yet
Development

No branches or pull requests

5 participants