developergovindgupta / multi-range-slider-react-ts

single component to select range value from slider with no other dependency.
14 stars 9 forks source link

Labels are added dynamically #3

Open E1NSER opened 9 months ago

E1NSER commented 9 months ago

During initialization, the labels are set perfectly. However, if we dynamically change the labels, and they are not the same as before, a new label will be created and added, resulting in, for example, two labels. This happens because you are using the label's value as the key in your loop. This issue could be prevented by using the index instead of the key.

https://github.com/developergovindgupta/multi-range-slider-react-ts/blob/73104e5729ea494c3d5276202f446adbba50b66f/src/components/multirangeslider.tsx#L432C4-L442C6

Solved here: #4