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

Values not working in range select #15

Open BenasPaulikas opened 9 years ago

BenasPaulikas commented 9 years ago
echo $form->field($model, 'hours')->widget(Slider::classname(), [
            'value' => '5,7',
            'pluginOptions' => [
                'min' => 0,
                'max' => 24,
                'step' => 1,
                'range' => true
            ]
        ]);

I selected current max value as 7, but it's 24.. git

--- Want to back this issue? **[Post a bounty on it!](https://www.bountysource.com/issues/26045405-values-not-working-in-range-select?utm_campaign=plugin&utm_content=tracker%2F2315488&utm_medium=issues&utm_source=github)** We accept bounties via [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F2315488&utm_medium=issues&utm_source=github).
spotykatch commented 1 year ago

Sims like, due to changes in yii\widgets\InputWidget, $this->value is set to $this->options['value'] or to input value.

echo $form->field($model, 'hours')->widget(Slider::classname(), [
  'options' => [
    'value' => '5,7',
  ],
  'pluginOptions' => [
    'min' => 0,
    'max' => 24,
    'step' => 1,
    'range' => true
  ]
]);