Skip to content

Commit

Permalink
Add shift times ten multiplier (#1620)
Browse files Browse the repository at this point in the history
  • Loading branch information
robines authored Dec 8, 2024
1 parent f8801a7 commit f691f78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion frontend/src/Components/NumberInput/NumberInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ export const NumberInput = React.forwardRef<HTMLInputElement, NumberInputProps>(
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);
Expand Down

0 comments on commit f691f78

Please sign in to comment.