File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -97,7 +97,7 @@ class InputSpinner extends Component {
9797 * @private
9898 */
9999 _setStateMin ( callback = null ) {
100- return this . setState ( { value : this . state . max } , callback ) ;
100+ return this . setState ( { value : this . state . min } , callback ) ;
101101 }
102102
103103 /**
@@ -338,8 +338,9 @@ class InputSpinner extends Component {
338338 */
339339 async increase ( ) {
340340 if ( this . _isDisabledButtonRight ( ) ) return ;
341- let num = this . parseNum ( this . state . value ) + this . parseNum ( this . state . step ) ;
342- if ( this . maxReached ( num ) ) {
341+ let currentValue = this . parseNum ( this . state . value ) ;
342+ let num = currentValue + this . parseNum ( this . state . step ) ;
343+ if ( this . maxReached ( currentValue ) ) {
343344 return ;
344345 }
345346 if ( this . props . onIncrease ) {
@@ -366,8 +367,9 @@ class InputSpinner extends Component {
366367 */
367368 async decrease ( ) {
368369 if ( this . _isDisabledButtonLeft ( ) ) return ;
369- let num = this . parseNum ( this . state . value ) - this . parseNum ( this . state . step ) ;
370- if ( this . minReached ( num ) ) {
370+ let currentValue = this . parseNum ( this . state . value ) ;
371+ let num = currentValue - this . parseNum ( this . state . step ) ;
372+ if ( this . minReached ( currentValue ) ) {
371373 return ;
372374 }
373375 if ( this . props . onDecrease ) {
You can’t perform that action at this time.
0 commit comments