diff --git a/CHANGELOG.md b/CHANGELOG.md index ce337a92b..6962a3142 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - mobile pagination +### Fixed + +- Fix incorrect regex on Number Input that prevents "-" sign from being entered + ## [0.2.18] - 2023-09-29 ### Added diff --git a/src/components/input/numberInput.tsx b/src/components/input/numberInput.tsx index 1ff442ade..4a7900c91 100644 --- a/src/components/input/numberInput.tsx +++ b/src/components/input/numberInput.tsx @@ -52,7 +52,7 @@ export const NumberInput: React.FC = ({ const handleChange = (event: React.ChangeEvent) => { // this handles pasting in the value/ could also use onPaste event if (!includeDecimal) { - event.target.value = event.target.value.replace(/[^0-9]/g, ''); + event.target.value = event.target.value.replace(/[^-0-9]/g, ''); } onChange?.(event);