kartik-v / yii2-slider

A slider input with orientations, range selections and more features based on bootstrap-slider.
http://demos.krajee.com/slider
Other
28 stars 20 forks source link

Allow 0 to be a valid value #6

Closed jasonhancock closed 9 years ago

jasonhancock commented 9 years ago

If I set value to 0, it would get rendered as null:

 echo Slider::widget([
            'name' => 'somevalue',
            'value'=> 0,
            'pluginOptions' => [
                'min' => 0,
                'max' => 15,
                'step' => .25
            ],
        ]);
var slider_bf093871 = {"min":0,"max":15,"step":0.25,"value":null,"id":"w0-slider"};

And the slider would get positioned at some random value.

With my patch, it renders correctly:

var slider_449938cc = {"min":0,"max":15,"step":0.25,"value":0,"id":"w0-slider"};
kartik-v commented 9 years ago

Thanks.