Skip to content

Commit 79a0904

Browse files
committed
fix: auto update of value
1 parent 332573d commit 79a0904

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,13 @@ class InputSpinner extends Component {
5555
*/
5656
componentDidUpdate(prevProps) {
5757
// Parse Value
58-
if (this.props.value !== prevProps.value) {
58+
if (this.props.value !== this.state.value) {
5959
let newValue = this.parseNum(this.props.value);
6060
newValue = this.withinRange(newValue);
6161
this.setState({value: newValue});
6262
}
6363
// Parse Min
64-
if (this.props.min !== prevProps.min) {
64+
if (this.props.min !== this.state.min) {
6565
this.setState({
6666
min:
6767
this.props.min != null
@@ -70,7 +70,7 @@ class InputSpinner extends Component {
7070
});
7171
}
7272
// Parse Max
73-
if (this.props.max !== prevProps.max) {
73+
if (this.props.max !== this.state.max) {
7474
this.setState({
7575
max:
7676
this.props.max != null
@@ -79,7 +79,7 @@ class InputSpinner extends Component {
7979
});
8080
}
8181
// Parse Step
82-
if (this.props.step !== prevProps.step) {
82+
if (this.props.step !== this.state.step) {
8383
let spinnerStep = this.parseNum(this.props.step);
8484
if (!this.typeDecimal() && spinnerStep < 1) {
8585
spinnerStep = 1;

0 commit comments

Comments
 (0)