feat: numeric validation
This commit is contained in:
parent
43cb09e048
commit
8a3b1654e4
|
@ -30,7 +30,13 @@ const Number = ({
|
|||
: (
|
||||
<>
|
||||
<input
|
||||
onChange={(event) => onChange(event.target.value, event)}
|
||||
onChange={(event) => {
|
||||
const {value: number} = event.target;
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
if (!isNaN(number)) {
|
||||
onChange('' === number ? 0 : number, event);
|
||||
}
|
||||
}}
|
||||
// onWheel={(e) => (e.preventDefault(), false)}
|
||||
type="text"
|
||||
value={value}
|
||||
|
|
Loading…
Reference in New Issue
Block a user