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

Range control with a default value of zero does not adopt default value #549

Open
zackheil opened this issue Feb 4, 2024 · 0 comments
Open
Labels
bug Something isn't working

Comments

@zackheil
Copy link

zackheil commented Feb 4, 2024

Describe the bug

I tried setting a range control and wanted the default value to be zero. I discovered that this works for any non-zero value, but zero puts the range control at 50% visually and you get the react warning when setting it for the first time Warning: A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component.

Reproduction

Here's a stackblitz repro: https://stackblitz.com/edit/ladle-jcsl2b?file=src%2Fbasic.stories.tsx

Environment

  • OS: (all)
  • Browser: (all)
  • Version: Has existed since at least 2.x.x
@zackheil zackheil added the needs triage needs to be reviewed label Feb 4, 2024
@tajo tajo added bug Something isn't working and removed needs triage needs to be reviewed labels Feb 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants