Menu icon Foundation
Possible bug in range slider? Update Options does not work

I'm not sure if this is a bug or I'm just a bit stupid. Tried to find a solution but had no luck so far.

I'm trying to change the data-options for a slider (Foundation 6.4.2). My code sets the range to new parameters, but the slider still use the old parameters. I can see at runtime, that the new options are there, but they are not used.

I created a Pen to show the issue: https://codepen.io/XSized/pen/djyVjm

I initialize the slider with start:0; step:0.5; end:12; and change it to start:5; step:0.5; end:20; - I can see the options in the code in DevTools, but the slider still use end:12 and not 20. And I have no idea why...

sliderrange-slider

I'm not sure if this is a bug or I'm just a bit stupid. Tried to find a solution but had no luck so far.

I'm trying to change the data-options for a slider (Foundation 6.4.2). My code sets the range to new parameters, but the slider still use the old parameters. I can see at runtime, that the new options are there, but they are not used.

I created a Pen to show the issue: https://codepen.io/XSized/pen/djyVjm

I initialize the slider with start:0; step:0.5; end:12; and change it to start:5; step:0.5; end:20; - I can see the options in the code in DevTools, but the slider still use end:12 and not 20. And I have no idea why...

Stacy Oneal 12 days ago

Is there a workaround for this or is this a common problem? It seems that the slider ui tries to round, floor or ceil the values, but this must NOT be done with handles that aren't moved at all. Instead, this should be done right after releasing a handle and ONLY with the used handle, not the one that hasn't been touched at all.

Sophia 12 days ago

The nature of dynamically changing content typically requires other methods anyway. I believe Select2 doesn't require a dynamic data method. Rather, a standard added to the documentation of a basic dynamic data change would be a clear enough solution. I have found the solution of this problem in nursing essays site, there is an assignment in which define all the solution of this problem, at this moment I don't have but I am telling you in detail after a couple of days 

 

Mirko Weisse 12 days ago

I learned, that I should use Foundation.reInit($('#gns')) instead of _reflow, but this changes nothing, same effect for me.

Mirko Weisse 12 days ago

Have a solution now:

Destroy the slider and reinitilize

 

$('#gns').foundation('destroy');
$('#gns').foundation();