From a29e146dc18845123d3c5491fd707819ae483c3b Mon Sep 17 00:00:00 2001 From: Owen Moogk <58040528+owenmoogk@users.noreply.github.com> Date: Thu, 7 Nov 2024 11:49:03 +0100 Subject: [PATCH] [@mantine/core] NumberInput: Fix `min`/`max` value being bypassed if `0` has been entered as the first digit (#7021) * Fix number input NaN issue * Fix issue with clamping the replaced value --- .../@mantine/core/src/components/NumberInput/NumberInput.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@mantine/core/src/components/NumberInput/NumberInput.tsx b/packages/@mantine/core/src/components/NumberInput/NumberInput.tsx index 5b046a19ef5..88cef2654a5 100644 --- a/packages/@mantine/core/src/components/NumberInput/NumberInput.tsx +++ b/packages/@mantine/core/src/components/NumberInput/NumberInput.tsx @@ -477,7 +477,7 @@ export const NumberInput = factory((_props, ref) => { setValue( Number.isNaN(parsedValue) || parsedValue > Number.MAX_SAFE_INTEGER ? replaced - : parsedValue + : clamp(parsedValue, min, max) ); } }}