@@ -191,7 +191,7 @@ class InputSpinner extends Component {
191191 * Increase
192192 */
193193 increase ( ) {
194- if ( this . props . disabled ) return ;
194+ if ( this . _isDisabledButtonRight ( ) ) return ;
195195 let num =
196196 this . parseNum ( this . state . value ) + this . parseNum ( this . state . step ) ;
197197 if ( this . props . onIncrease ) {
@@ -208,7 +208,7 @@ class InputSpinner extends Component {
208208 * Decrease
209209 */
210210 decrease ( ) {
211- if ( this . props . disabled ) return ;
211+ if ( this . _isDisabledButtonLeft ( ) ) return ;
212212 let num =
213213 this . parseNum ( this . state . value ) - this . parseNum ( this . state . step ) ;
214214 if ( this . props . onDecrease ) {
@@ -262,6 +262,24 @@ class InputSpinner extends Component {
262262 return ! this . props . disabled && this . props . editable ;
263263 }
264264
265+ /**
266+ * Is left button disabled
267+ * @returns {Boolean }
268+ * @private
269+ */
270+ _isDisabledButtonLeft ( ) {
271+ return ( this . props . disabled || this . props . buttonRightDisabled ) ;
272+ }
273+
274+ /**
275+ * Is right button disabled
276+ * @returns {Boolean }
277+ * @private
278+ */
279+ _isDisabledButtonRight ( ) {
280+ return ( this . props . disabled || this . props . buttonRightDisabled ) ;
281+ }
282+
265283 /**
266284 * Is right button pressed
267285 * @returns {boolean }
@@ -572,6 +590,7 @@ class InputSpinner extends Component {
572590 underlayColor = { this . _getColorPress ( ) }
573591 onHideUnderlay = { this . onHideUnderlay . bind ( this ) }
574592 onShowUnderlay = { this . onShowUnderlay . bind ( this , "left" ) }
593+ disabled = { this . _isDisabledButtonLeft ( ) }
575594 style = { buttonStyle }
576595 onPress = { ( ) => this . decrease ( ) } >
577596 { this . _renderLeftButtonElement ( ) }
@@ -605,6 +624,7 @@ class InputSpinner extends Component {
605624 underlayColor = { this . _getColorPress ( ) }
606625 onHideUnderlay = { this . onHideUnderlay . bind ( this ) }
607626 onShowUnderlay = { this . onShowUnderlay . bind ( this , "right" ) }
627+ disabled = { this . _isDisabledButtonLeft ( ) }
608628 style = { buttonStyle }
609629 onPress = { ( ) => this . increase ( ) } >
610630 { this . _renderRightButtonElement ( ) }
@@ -673,6 +693,8 @@ InputSpinner.propTypes = {
673693 onMax : PropTypes . func ,
674694 onIncrease : PropTypes . func ,
675695 onDecrease : PropTypes . func ,
696+ buttonLeftDisabled : PropTypes . bool ,
697+ buttonRightDisabled : PropTypes . bool ,
676698 buttonLeftText : PropTypes . string ,
677699 buttonRightText : PropTypes . string ,
678700 buttonLeftImage : PropTypes . element ,
@@ -714,6 +736,8 @@ InputSpinner.defaultProps = {
714736 editable : true ,
715737 width : 150 ,
716738 height : 50 ,
739+ buttonLeftDisabled : false ,
740+ buttonRightDisabled : false ,
717741 buttonLeftText : null ,
718742 buttonRightText : null ,
719743 buttonStyle : { } ,
0 commit comments