Skip to content

Commit

Permalink
fix: webui InputNumber range check fails when min or max equals 0 (#4284
Browse files Browse the repository at this point in the history
)
  • Loading branch information
jinyang1994 authored Nov 16, 2023
1 parent 234de53 commit 2e4bf51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions webui/src/components/form/InputNumber.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export default function InputNumber({
return onChange?.(e.target.value as unknown as number)

// check range
if (max && value > max)
if (max !== undefined && value > max)
value = max
if (min && value < min)
if (min !== undefined && value < min)
value = min
onChange?.(value)
}, [onChange, min, max])
Expand Down

0 comments on commit 2e4bf51

Please sign in to comment.