@@ -336,7 +336,11 @@ class InputSpinner extends Component {
336336 * @returns {* }
337337 */
338338 getPlaceholder ( ) {
339- if ( isEmpty ( this . props . placeholder ) ) {
339+ if ( ! isEmpty ( this . props . placeholder ) ) {
340+ return this . props . placeholder ;
341+ } else if ( isEmpty ( this . state . value ) && this . isEmptied ( ) ) {
342+ return "" ;
343+ } else {
340344 return String ( this . state . min ) ;
341345 } else {
342346 return this . props . placeholder ;
@@ -548,6 +552,14 @@ class InputSpinner extends Component {
548552 return ! this . props . disabled && this . props . editable ;
549553 }
550554
555+ /**
556+ * If input can be empty
557+ * @returns {boolean|Boolean }
558+ */
559+ isEmptied ( ) {
560+ return this . props . emptied ;
561+ }
562+
551563 /**
552564 * Is text input focused
553565 * @returns {boolean|Boolean }
@@ -1011,8 +1023,9 @@ InputSpinner.propTypes = {
10111023 onDecrease : PropTypes . func ,
10121024 onSubmit : PropTypes . func ,
10131025 onLongPress : PropTypes . func ,
1014- onLongPressDelay : PropTypes . number ,
1015- onLongPressSpeed : PropTypes . number ,
1026+ accelerationDelay : PropTypes . number ,
1027+ speed : PropTypes . number ,
1028+ emptied : PropTypes . bool ,
10161029 typingTime : PropTypes . number ,
10171030 buttonLeftDisabled : PropTypes . bool ,
10181031 buttonRightDisabled : PropTypes . bool ,
@@ -1069,8 +1082,9 @@ InputSpinner.defaultProps = {
10691082 returnKeyType : null ,
10701083 width : 150 ,
10711084 height : 50 ,
1072- onLongPressDelay : defaultLongPressDelay ,
1073- onLongPressSpeed : defaultLongPressSpeed ,
1085+ accelerationDelay : defaultAccelerationDelay ,
1086+ speed : defaultSpeed ,
1087+ emptied : false ,
10741088 typingTime : defaultTypingTime ,
10751089 buttonLeftDisabled : false ,
10761090 buttonRightDisabled : false ,
0 commit comments