Skip to content

Commit

Permalink
Merge pull request #382 from eternal0/master
Browse files Browse the repository at this point in the history
Fix percentage in initial state for Slider
  • Loading branch information
Hai Nguyen committed Mar 4, 2015
2 parents 1b670a9 + e97d59d commit 0c41829
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/slider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0c41829

Please sign in to comment.