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

Incorrect value displaying on dynamically changing min value to equal to max value #40827

Closed
didolf opened this issue Feb 20, 2023 · 1 comment

Comments

@didolf
Copy link

didolf commented Feb 20, 2023

Reproduction link

Edit on CodeSandbox

Steps to reproduce

Set up min to 1 max to 10
Change value to 5
Change min to 10

What is expected?

handle positioned on start of rail, track width = 0

What is actually happening?

handle positioned on center of rail, track width != 0

Environment Info
antd 5.2.2
React 18.2
System MacOS
Browser Chrome 110

Fix this issue can help react-component/slider#860

@zombieJ
Copy link
Member

zombieJ commented Feb 20, 2023

Since it's meaningless for max value equals min value, I don't think it should be 'a rule' to guide what it should look like. But if you need this, you can HOC for slider:
https://codesandbox.io/s/antd-reproduction-template-forked-7tiwnn?file=/index.js

@zombieJ zombieJ closed this as completed Feb 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants