From a7ba2db9aed566fb3fd881bf7338076cdd931a8d Mon Sep 17 00:00:00 2001 From: robines Date: Sun, 17 Nov 2024 18:05:22 +0100 Subject: [PATCH] Add shift times ten multiplier --- frontend/src/Components/NumberInput/NumberInput.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/Components/NumberInput/NumberInput.tsx b/frontend/src/Components/NumberInput/NumberInput.tsx index bfa44b165..36e7ae8a1 100644 --- a/frontend/src/Components/NumberInput/NumberInput.tsx +++ b/frontend/src/Components/NumberInput/NumberInput.tsx @@ -97,7 +97,9 @@ export const NumberInput = React.forwardRef( if (event.key === 'ArrowUp' || event.key === 'ArrowDown') { event.preventDefault(); const add = event.key === 'ArrowUp' ? 1 : -1; - const newVal = clampValue((Number(inputValue) || 0) + add); + const multiplier = event.shiftKey ? 10 : 1; + + const newVal = clampValue((Number(inputValue) || 0) + add * multiplier); if (!Number.isNaN(newVal)) { setInputValue(newVal); onChange?.(newVal);