If an update results in changing the Slider component's value and max attributes simultaneously, the new value will not be properly updated.
This seems caused by the reactive call to slider.updateOptions(...) in the Slider component, which causes the new value to be overwritten by the previous one in slider.on('update', ...).
A quick hack to confirm it is done by adding let newValue = value; before the updateOptions call, and add if (newValue !== localValue) slider.set(newValue, false); after the call, which makes the issue go away. However I did not spend more time yet understanding the inner workings, so this might not be the proper way to fix it.
If an update results in changing the Slider component's value and max attributes simultaneously, the new value will not be properly updated.
This seems caused by the reactive call to
slider.updateOptions(...)
in the Slider component, which causes the newvalue
to be overwritten by the previous one inslider.on('update', ...)
.A quick hack to confirm it is done by adding
let newValue = value;
before theupdateOptions
call, and addif (newValue !== localValue) slider.set(newValue, false);
after the call, which makes the issue go away. However I did not spend more time yet understanding the inner workings, so this might not be the proper way to fix it.Here is the REPL reproducing this issue: https://svelte.dev/repl/290f909a3f30472db4c9a0e84560169a After clicking the button, the thumb should be located at 0, however it remains at its original value of 10.
Thanks!