svelte-range-slider-pips: [bug] Svelte 5 Range handles are not moving when dragged.
Describe the bug
The slider handles are not moving even tho the value is being read and the handler recognizes the value
EDIT: It looks like this is, in general, an issue with bind: values = {...} and it is not limited to range property. As soon as you bind the values the slider handles will stop moving.
To Reproduce
Steps to reproduce the behavior:
- npmi
svelte-range-slider-pipscomponents into svelte 5 project
let {min, max} = $props();
// old export let min
let values = $state([0, 8]);
// old $: values = [0,8]
<RangeSlider
float
range
pips
hoverable
{id}
{min}
{max}
all="label"
bind:values
on:stop={someHandler} />
- Run in Vite
Screenshots As seen from the picture below, even tho the handle was moved and the value was read, the actual handle element stayed in place.
Device/Environtment
Svelte 5 with typescript and sveltekit 2
Additional context I have noticed that this component is on svelte 3.0.0. It would be great to create an alpha version of svelte-range-slider-pips that is accommodating the new runes system. If not, it should be crosscompatible with at least Svelte 4.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 17 (10 by maintainers)
Commits related to this issue
- fix: better interop of `$state` with actions/`$:` statements Ensure update methods of actions and reactive statements work with fine-grained `$state` by deep-reading them. This is necessary because m... — committed to sveltejs/svelte by dummdidumm 3 years ago
- fix: better interop of `$state` with actions/`$:` statements (#10543) Ensure update methods of actions and reactive statements work with fine-grained `$state` by deep-reading them. This is necessary ... — committed to sveltejs/svelte by dummdidumm 3 years ago
The problem is on Svelte’s side. The problem is the combination of passing in
$state(which is fine-grained, compared to the oldletwhich is not) in combination with the transformation of$:which only checks that the property as a whole, not its properties, have changed, in order to rerun. https://github.com/sveltejs/svelte/pull/10543 will fix this.I’ve installed the beta version, unfortunately, the issue with handles moving is persisting on Svelte 5 with Sveltekit 2
It looks like the value is updated but the nub is not moving still…