diff --git a/theatre/studio/src/uiComponents/form/BasicNumberInput.tsx b/theatre/studio/src/uiComponents/form/BasicNumberInput.tsx index db906e0..dedef74 100644 --- a/theatre/studio/src/uiComponents/form/BasicNumberInput.tsx +++ b/theatre/studio/src/uiComponents/form/BasicNumberInput.tsx @@ -241,7 +241,7 @@ const BasicNumberInput: React.FC<{ const onDrag = (deltaX: number, _dy: number) => { const curState = refs.current.state as IState_Dragging - const newValue = + let newValue = curState.valueBeforeDragging + propsA.nudge({ deltaX, @@ -249,6 +249,10 @@ const BasicNumberInput: React.FC<{ magnitude: 1, }) + if (propsA.range) { + newValue = clamp(newValue, propsA.range[0], propsA.range[1]) + } + setState({ ...curState, currentDraggingValue: newValue,