From 5e983558967f0b981bc2b8477355f49e0c86aab2 Mon Sep 17 00:00:00 2001 From: Botzy Date: Mon, 10 Feb 2025 12:37:40 +0200 Subject: [PATCH] fix(NumberInput): fix check for min and max values --- src/components/NumberInput/NumberInput.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/NumberInput/NumberInput.tsx b/src/components/NumberInput/NumberInput.tsx index 391017fc1..874019162 100644 --- a/src/components/NumberInput/NumberInput.tsx +++ b/src/components/NumberInput/NumberInput.tsx @@ -32,7 +32,7 @@ const NumberInput = forwardRef(({ defaultValue, ...prop const handleIncrease = () => { const { max } = props; - if (max) { + if (typeof max !== 'undefined') { return setValue((prevVal) => prevVal + 1 > max ? max : prevVal + 1 ); @@ -42,7 +42,7 @@ const NumberInput = forwardRef(({ defaultValue, ...prop const handleDecrease = () => { const { min } = props; - if (min) { + if (typeof min !== 'undefined') { return setValue((prevVal) => prevVal - 1 < min ? min : prevVal - 1 ); @@ -55,7 +55,7 @@ const NumberInput = forwardRef(({ defaultValue, ...prop {props.showButtons ? : null}
@@ -72,7 +72,7 @@ const NumberInput = forwardRef(({ defaultValue, ...prop />
{props.showButtons ? : null}