summaryrefslogtreecommitdiff
path: root/apps/web/src/components/ui/number-field.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'apps/web/src/components/ui/number-field.tsx')
-rw-r--r--apps/web/src/components/ui/number-field.tsx7
1 files changed, 5 insertions, 2 deletions
diff --git a/apps/web/src/components/ui/number-field.tsx b/apps/web/src/components/ui/number-field.tsx
index 35cce81b..48297dc0 100644
--- a/apps/web/src/components/ui/number-field.tsx
+++ b/apps/web/src/components/ui/number-field.tsx
@@ -71,9 +71,12 @@ function NumberField({
return;
}
cumulativeDeltaRef.current += moveEvent.movementX;
+ const sensitivity =
+ typeof dragSensitivity === "number"
+ ? dragSensitivity
+ : DRAG_SENSITIVITIES[dragSensitivity];
const newValue =
- startValueRef.current +
- cumulativeDeltaRef.current * DRAG_SENSITIVITIES[dragSensitivity];
+ startValueRef.current + cumulativeDeltaRef.current * sensitivity;
onScrub(newValue);
};