MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getPercentValue

Function getPercentValue

packages/react-stately/src/slider/useSliderState.ts:367–370  ·  view source on GitHub ↗
(percent: number)

Source from the content-addressed store, hash-verified

365 }
366
367 function getPercentValue(percent: number) {
368 const val = percent * (maxValue - minValue) + minValue;
369 return clamp(getRoundedValue(val), minValue, maxValue);
370 }
371
372 function incrementThumb(index: number, stepSize: number = 1) {
373 let s = Math.max(stepSize, step);

Callers 1

setThumbPercentFunction · 0.85

Calls 2

clampFunction · 0.90
getRoundedValueFunction · 0.85

Tested by

no test coverage detected