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

Fix useInput incorrectly set default value for numbers #6374

Merged
merged 1 commit into from
Jun 21, 2021

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Jun 21, 2021

Problem

<NumberInput> changes its value to its defaultValue or initialValue when it reaches zero.

If you try to do this: <NumberInput source="test" min={-10} max={10} defaultValue={6} />

It will go back to 6 when it reaches 0, like this

l6tTZFrzAg

@djhi djhi added the RFR Ready For Review label Jun 21, 2021
@djhi djhi added this to the 3.16.3 milestone Jun 21, 2021
@fzaninotto fzaninotto merged commit 49810c3 into master Jun 21, 2021
@fzaninotto fzaninotto deleted the fix-use-input-default-value branch June 21, 2021 11:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants