(index: number, value: number)
| 294 | } |
| 295 | |
| 296 | function updateValue(index: number, value: number) { |
| 297 | if (isDisabled || !isThumbEditable(index)) { |
| 298 | return; |
| 299 | } |
| 300 | const thisMin = getThumbMinValue(index); |
| 301 | const thisMax = getThumbMaxValue(index); |
| 302 | |
| 303 | // Round value to multiple of step, clamp value between min and max |
| 304 | value = snapValueToStep(value, thisMin, thisMax, step); |
| 305 | let newValues = replaceIndex(valuesRef.current, index, value); |
| 306 | setValues(newValues); |
| 307 | } |
| 308 | |
| 309 | function updateDragging(index: number, dragging: boolean) { |
| 310 | if (isDisabled || !isThumbEditable(index)) { |
no test coverage detected