Rachana Ramchand
Rachana Ramchand

Reputation: 49

Bootstrap Numeric Slider - wrong value on clicking

So I'm using eyecon.ro/bootstrap-slider for the numeric slider in my app, but it's really buggy. On sliding it, no issues in the value being returned. But when I click it the first time (at any point), I'm getting a random value. When I click it again, only then am I getting the right value.

<input type="text" class="span2 spiders" value="" data-slider-min="0" data-slider-max="100" data-slider-step="1" data-slider-value="55.5" id="<%= 'sld'+details["id"] %>" data-slider-selection="after" data-slider-tooltip="hide">

$(function(){


    $("input[id^='sld']").slider({

      formater: function(value) {


        value=Math.round(value*10)/10;

        return 'Current value: '+value;
      }
    });  

    });  

Any way to resolve this? Also, over here no issue is faced. http://jsfiddle.net/vMLPF/1/

Upvotes: 0

Views: 1048

Answers (1)

Mihkel
Mihkel

Reputation: 679

This bug was caused by the event firing before the input value being modified. This bug was fixed in the following commit:

https://github.com/seiyria/bootstrap-slider/commit/88ef288e78b99e2964ba68ce6a33944f47b7d6b7

Upvotes: 1

Related Questions