assure that the value is either emtpy or 0 (#2243)

fixes: #1941
This commit is contained in:
Erik Jan de Wit 2022-03-18 14:21:21 +01:00 committed by GitHub
parent 68a8c29a8a
commit f71cbf171a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -32,7 +32,10 @@ export const DisplayOrder = () => {
value={value}
data-testid="displayOrder"
min={0}
onChange={onChange}
onChange={(value) => {
const num = Number(value);
onChange(value === "" ? value : num < 0 ? 0 : num);
}}
/>
)}
/>