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

Parser should allow to return null instead of a number #315

Open
Mathieuu opened this issue Apr 9, 2021 · 1 comment
Open

Parser should allow to return null instead of a number #315

Mathieuu opened this issue Apr 9, 2021 · 1 comment

Comments

@Mathieuu
Copy link

Mathieuu commented Apr 9, 2021

Typescript should allow the parser function to return null or undefined. Sometimes, we want to leave a number field empty and not default to 0.

See the example below:

https://codesandbox.io/s/inputnumber-antd-14150-forked-higgh?file=/index.tsx

Sidenote: <InputNumber<number | undefined> does not work because T extends valueTypes which is number | string

@Mathieuu Mathieuu changed the title parser prop should allow to return null or undefined parser should allow to return null instead of a number Apr 9, 2021
@Mathieuu Mathieuu changed the title parser should allow to return null instead of a number Parser should allow to return null instead of a number Apr 9, 2021
@hugo1o1
Copy link

hugo1o1 commented Jul 29, 2021

add @ts-ignore to the parser function 😂
acturally onChange will return null instead undefined even if your parser function return undefined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants