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

NumField with default value should allow clearing field before entering new value #856

Closed
xormik opened this issue Jan 15, 2021 · 1 comment · Fixed by #858
Closed

NumField with default value should allow clearing field before entering new value #856

xormik opened this issue Jan 15, 2021 · 1 comment · Fixed by #858
Assignees
Labels
Type: Bug Bug reports and their fixes
Milestone

Comments

@xormik
Copy link

xormik commented Jan 15, 2021

In the NumField component, when a default value exists, it can't be cleared out, but this should be allowed. E.g. When backspacing the last digit left, the value is replaced with the default value. This happens in all the components except in the uniforms-antd component, where the onChange handler is different.
uniforms-antd's onChange
uniforms-material's onChange

In this playground example, try to backspace the 2 to change it to another number.

@radekmie radekmie self-assigned this Jan 15, 2021
@radekmie radekmie added the Type: Bug Bug reports and their fixes label Jan 15, 2021
@radekmie
Copy link
Contributor

Hi @xormik. It's mostly because AntD has a custom InputNumber component that works differently from <input type="number" />. I do agree that it is a problem though. Another thing is that if you remove the value from using the AntD theme the value becomes '' (and null on blur), which leads to should be number error. Thanks for the report!

@radekmie radekmie linked a pull request Jan 20, 2021 that will close this issue
@radekmie radekmie added this to the v3.0 milestone Apr 22, 2022
@radekmie radekmie moved this to Closed in Open Source Nov 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug reports and their fixes
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants