From e97d59d08205d6ed0e688978585474cab77eed78 Mon Sep 17 00:00:00 2001 From: Gene Trog Date: Mon, 2 Mar 2015 21:25:48 -0500 Subject: [PATCH] Fix percentage in initial state for Slider getInitialState() in Slider doesn't compute percentage value correctly, like setValue() does. --- src/js/slider.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/js/slider.jsx b/src/js/slider.jsx index f2195de130946b..6e0cfbb25be212 100644 --- a/src/js/slider.jsx +++ b/src/js/slider.jsx @@ -36,7 +36,7 @@ var Slider = React.createClass({ getInitialState: function() { var value = this.props.value; if (value == null) value = this.props.defaultValue; - var percent = value / this.props.max; + var percent = (value - this.props.min) / (this.props.max - this.props.min); if (isNaN(percent)) percent = 0; return { value: value,