Skip to content

Commit 08765eb

Browse files
committed
fix: step acting weird when negatives are disallowed
1 parent d5fbd21 commit 08765eb

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/components/CurrencyInput.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,10 @@ export const CurrencyInput: FC<CurrencyInputProps> = forwardRef<
277277
) || 0;
278278
const newValue = key === 'ArrowUp' ? currentValue + step : currentValue - step;
279279

280-
if (min !== undefined && newValue < Number(min)) {
280+
if (
281+
(min !== undefined && newValue < Number(min)) ||
282+
(!allowNegativeValue && newValue < 0)
283+
) {
281284
return;
282285
}
283286

0 commit comments

Comments
 (0)