sc-slider
Hi 👋 I 'm trying to make this slider work . The values should be 0 -10 which I have set as the min /max values . The value is linked to a var , as is the default -value . The min /max buttons update the var and clicking them works . When i click max , the slider goes all the way to the right , and when I click Min the slider goes all the way to the left . The problem is I can 't actually interact with the slider . When I try to click and drag the thumb nothing happens . I can 't slide the slider . . . Set up attached . Any help appreciated 🙏 ✅1hey Bobby , thanks for the reply 🙂 Thanks ! OK so If I set onValueChange it seems to work . The problem now is that I have an API call that is linked to this var that fires when it changes . I want this to happen , but ideally I 'd like it to fire once the user has let go of the thumb , which I assume is what onValueCommit is for . However , if I use onValueCommit rather than onValueChange , I have the original problem of not being able to drag the thumb . Hope that makse sense I think then it might be an issue with the way your var is being set and passed in . 'sc -slider -root ' expects an array for value . So if you are passing event .value into your var , it 's already an array and you should just be setting the var directly in 'sc -slider -root ' with your var . Your screenshot seems to show that you might be passing the var through an array structure in your value function . I had it set to extract the number from the array when setting the var , then was setting it back to an array for the value (purely for ease of use with the API call ) . Anyway , I 've changed it to as it should be but still not able to drag it . This is the current set up . The default -value and value have the same formular (just taking it from the var ) it seems like because the value is set to [0 ] , it won 't move from that state . SOLVED I had to use 2 seperate vars . 1 to hold the value state of the slider (with a default value of [0 ] and updates onValueChange ) , this var then sets the default -value and value of the slider . A second var to hold the committed value I need for the filters and API call . This updates onValueCommit . Got there in the end 🙌 Thanks for helping debug @Bobby Randhawa 👍




.jpeg/public)