Skip to content

Commit 161a772

Browse files
author
Marco Cesarato
committed
feat: add continuos method
1 parent 75950bb commit 161a772

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/InputSpinner.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -460,7 +460,7 @@ class InputSpinner extends Component {
460460
if (
461461
this.maxReached(currentValue) &&
462462
!this.isEmptied() &&
463-
this.props.continuity !== false
463+
this.isContinuos()
464464
) {
465465
// Continuity mode
466466
num = this.state.min;
@@ -502,7 +502,7 @@ class InputSpinner extends Component {
502502
if (
503503
this.minReached(currentValue) &&
504504
!this.isEmptied() &&
505-
this.props.continuity !== false
505+
this.isContinuos()
506506
) {
507507
// Continuity mode
508508
num = this.state.max;
@@ -639,6 +639,14 @@ class InputSpinner extends Component {
639639
return !this.props.disabled && this.props.editable;
640640
}
641641

642+
/**
643+
* If continuity mode enabled
644+
* @returns {boolean|Boolean}
645+
*/
646+
isContinuos() {
647+
return this.props.continuity !== false;
648+
}
649+
642650
/**
643651
* If input can be empty
644652
* @returns {boolean|Boolean}

0 commit comments

Comments
 (0)