File tree Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Expand file tree Collapse file tree 3 files changed +5
-2
lines changed Original file line number Diff line number Diff line change 3434| ` fontFamily ` | Custom fontFamily of the text input of the Spinner | String | System Default | |
3535| ` fontSize ` | Custom fontSize of the text input of the Spinner | Number | ` 14 ` | |
3636| ` height ` | Custom height of the Spinner | Number | ` 50 ` | |
37+ | ` initialValue ` | Initial value of the Spinner | String<br >Number | ` 0 ` | |
3738| ` inputStyle ` | Input Style (Text number at middle) | Object | | Could overwrite other props |
3839| ` maxLength ` | Limits the maximum number of characters that can be entered. | Number | | |
3940| ` max ` | Max number permitted | String<br >Number | ` 0 ` | |
Original file line number Diff line number Diff line change @@ -105,7 +105,8 @@ Check the "[Props List](PROPS.md)" file to have the complete list of component p
105105| ` append ` | Custom element before right button | Component | | |
106106| ` autofocus ` | If ` true ` , focuses the input on ` componentDidMount ` . | | ` false ` | |
107107| ` disabled ` | Disable the Spinner or not | Boolean | ` false ` | |
108- | ` editable ` | Set if input number field is editable or not | Boolean | ` true ` | |
108+ | ` editable ` | Set if input number field is editable or not | Boolean | ` true ` | |
109+ | ` initialValue ` | Initial value of the Spinner | String<br >Number | ` 0 ` | |
109110| ` maxLength ` | Limits the maximum number of characters that can be entered. | Number | | |
110111| ` max ` | Max number permitted | String<br >Number | ` 0 ` |
111112| ` min ` | Min value permitted | String<br >Number | ` 99 ` |
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ class InputSpinner extends Component {
2929 this . state = {
3030 min : this . parseNum ( this . props . min ) ,
3131 max : this . parseNum ( this . props . max ) ,
32- value : this . parseNum ( this . props . value ) ,
32+ value : this . parseNum ( ! isNaN ( this . props . initialValue ) ? this . props . initialValue : this . props . value ) ,
3333 step : spinnerStep ,
3434 focused : false ,
3535 buttonPress : null ,
@@ -828,6 +828,7 @@ InputSpinner.defaultProps = {
828828 min : 0 ,
829829 max : 999 ,
830830 value : 0 ,
831+ initialValue : null ,
831832 step : 1 ,
832833 precision : 2 ,
833834 rounded : true ,
You can’t perform that action at this time.
0 commit comments