input-number
input-number copied to clipboard
Parser should allow to return null instead of a number
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
add @ts-ignore to the parser function 😂 acturally onChange will return null instead undefined even if your parser function return undefined
Agree to this request. Good to know you can just ignore the TS error but would be good to have the TS reflect it.