You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a slider with 3 handles. I'm using clickable pips to move a slider to that position - here's my pip click handler:
document.body.addEventListener("click", globalClickHandler);
function globalClickHandler(e) {
if (!e.target) return;
if (e.target.classList.contains("noUi-value")) { // click a pip
var pip = Number(e.target.dataset.value),
range = document.getElementById('range'),
curr = range.noUiSlider.get().map(Number);
curr[1] = pip; // set middle handle
range.noUiSlider.set(curr);
} else //...
Is there any easy way to move the closest slider to the value I want to set, rather than just updating the entire state of the ranges through .set() - I see there's an internal getClosestHandle method for calculating positions for tapping on the range but this uses a percentage rather than the raw number value I'm storing on the pips.
The text was updated successfully, but these errors were encountered:
I have a slider with 3 handles. I'm using clickable pips to move a slider to that position - here's my pip click handler:
Is there any easy way to move the closest slider to the value I want to set, rather than just updating the entire state of the ranges through
.set()
- I see there's an internalgetClosestHandle
method for calculating positions for tapping on the range but this uses a percentage rather than the raw number value I'm storing on the pips.The text was updated successfully, but these errors were encountered: