Skip to content

Commit

Permalink
Add shift times ten multiplier
Browse files Browse the repository at this point in the history
  • Loading branch information
robines committed Nov 17, 2024
1 parent 7f4b8b9 commit a7ba2db
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 a7ba2db

Please sign in to comment.