ydn-js origin

YUI version 2.6.0

Restoring silent setValues support to DualSlider

Background

YUI v2.5.2 supported DualSlider API setValues(...) passing true to a silent parameter, which prevented the change and slideEnd events from firing. This was so because setValues passed then input values to the respective minSlider and maxSlider's setValue.

In v2.6.0, the minSlider and maxSlider's setValue is called with silent always set to false because DualSlider maintains its properties minVal and maxVal in response to the min and maxSliders' slideEnd events, so the values would get out of sync if setValue was called with silent = true. The fallout from this change is that the silent flag is essentially ignored.

Workaround

A fix for this will be forthcoming in the next release, but in the mean time, implementers can use v2.5.2 of DualSlider or apply a patch to the DualSlider's setValues method. Additionally, getMinVal and getMaxVal methods are added to DualSlider's prototype to account for minVal and maxVal being unreliable. The v2.5.2 DualSlider has other bugs, so it is not recommended unless proven necessary.

CAVEAT: This workaround only works for animated DualSliders and only when setValue is called with the skipAnim parameter set to false.

slider thumb
slider thumb

.

Click update below to see reported minVal/maxVal are different than getMinVal()/getMaxVal().

.

Note events are fired, despite the silent param.

Slider values

slider.minVal: vs slider.getMinVal():

slider.maxVal: vs slider.getMaxVal():

Event Monitors

change fired
slideEnd fired