Closed AyoCodess closed 2 months ago
solution: use a key
hi @AyoCodess can you pls to elaborate what do you mean by use key? 🙌
hi @AyoCodess can you pls to elaborate what do you mean by use key? 🙌
On the component give it a key, then update that key somewhere else to unmount the component (reset it)
hi @AyoCodess can you pls to elaborate what do you mean by use key? 🙌
On the component give it a key, then update that key somewhere else to unmount the component (reset it)
oh, thanks for quick reply! if we do that way, isn't that it will have a glitch after you change the key, then first time sliding it ?
here is the way i toggle the key
<SliderScale
key={isValueEmpty ? 'reset_slider' : 'slider'}
/>
isValueEmpty
will be true after you press the Clear Button, or maybe I am wrong on handling the key
? @AyoCodess
hi @AyoCodess can you pls to elaborate what do you mean by use key? 🙌
On the component give it a key, then update that key somewhere else to unmount the component (reset it)
oh, thanks for quick reply! if we do that way, isn't that it will have a glitch after you change the key, then first time sliding it ?
here is the way i toggle the key
<SliderScale key={isValueEmpty ? 'reset_slider' : 'slider'} />
isValueEmpty
will be true after you press the Clear Button, or maybe I am wrong on handling thekey
? @AyoCodess
Could you make the default state of the slider start from the left side at 0, and not already filed up?
As when you hit clear, the slider is filled up completely.
same thing happend, it will like blinking that normal again, is this not happening on your end? @AyoCodess
same thing happend, it will like blinking that normal again, is this not happening on your end? @AyoCodess
I actually navigate away from the page so i don't see it blinking.
So when you reset it to 0 or to whatever starting number you set for your slider it does not animate to it?
This is definitely a missing feature either way.
I actually navigate away from the page so i don't see it blinking. ah ok thanks why you don't see the glitch,
So when you reset it to 0 or to whatever starting number you set for your slider it does not animate to it?
yess, exactly the same thing that you describe in this thread
ye i guess so, I am about to try to check the lib code, maybe can try to create a PR for that, anyway thanks for your quick replies! 🙌
via a button click i want to be able to reset the slider, i don't see a way how right now