Skip to content

Commit

Permalink
fix initialValue
Browse files Browse the repository at this point in the history
  • Loading branch information
testshallpass committed Nov 27, 2018
1 parent 681a5f4 commit cf42201
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/SimpleStepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ export default class SimpleStepper extends Component {
this.decrementStyle = this.imageStyle(props.imageWidth, props.imageHeight);
}
componentDidMount() {
this.validateValue(this.props.initialValue, this.props);
const { initialValue, value } = this.props;
// compare value and initialValue if different invoke valueChanged.
this.validateValue(initialValue, this.props, value !== initialValue);
}
componentWillReceiveProps(nextProps) {
const { initialValue, stepValue, minimumValue, maximumValue, disabled } = this.props;
Expand Down

0 comments on commit cf42201

Please sign in to comment.