@@ -259,10 +259,18 @@ class TextInput extends Component {
259
259
* Enable to make the input read only / disabled, disabled by default
260
260
*/
261
261
isReadOnly : PropTypes . oneOfType ( [ PropTypes . bool , PropTypes . func ] ) ,
262
+ /**
263
+ * Maximum value for input when type === number
264
+ */
265
+ max : PropTypes . number ,
262
266
/**
263
267
* Max amount of characters allowed in input
264
268
*/
265
269
maxLength : PropTypes . number ,
270
+ /**
271
+ * Minimum value for input when type === number
272
+ */
273
+ min : PropTypes . number ,
266
274
/**
267
275
* Input name
268
276
*/
@@ -300,9 +308,13 @@ class TextInput extends Component {
300
308
*/
301
309
shouldTrimValue : PropTypes . bool ,
302
310
/**
303
- * The HTML input type for the text input, the input only supports "email", "password", "text", "url" defaults to "text"
311
+ * Increment value when type === number
312
+ */
313
+ step : PropTypes . string ,
314
+ /**
315
+ * The HTML input type for the text input, the input only supports "email", "number", "password", "text", "url" defaults to "text"
304
316
*/
305
- type : PropTypes . oneOf ( [ "email" , "password" , "text" , "url" ] ) ,
317
+ type : PropTypes . oneOf ( [ "email" , "number" , " password", "text" , "url" ] ) ,
306
318
/**
307
319
* Prepopulate the input's value
308
320
*/
@@ -555,10 +567,13 @@ class TextInput extends Component {
555
567
id,
556
568
isOnDarkBackground,
557
569
isReadOnly,
570
+ max,
558
571
maxLength,
572
+ min,
559
573
name,
560
574
placeholder,
561
575
shouldAllowLineBreaks,
576
+ step,
562
577
type
563
578
} = this . props ;
564
579
const { isButtonFocused, isInputFocused, value } = this . state ;
@@ -575,13 +590,16 @@ class TextInput extends Component {
575
590
hasBeenValidated = { hasBeenValidated }
576
591
id = { id }
577
592
isOnDarkBackground = { isOnDarkBackground }
593
+ max = { max }
578
594
maxLength = { maxLength }
595
+ min = { min }
579
596
name = { name }
580
597
onBlur = { this . onInputBlur }
581
598
onChange = { this . onChange }
582
599
onFocus = { this . onInputFocus }
583
600
placeholder = { placeholder }
584
601
readOnly = { isReadOnly }
602
+ step = { step }
585
603
value = { value }
586
604
/>
587
605
{ this . showClearButton ( ) ? this . renderClearButton ( ) : null }
@@ -604,14 +622,17 @@ class TextInput extends Component {
604
622
hasBeenValidated = { hasBeenValidated }
605
623
id = { id }
606
624
isOnDarkBackground = { isOnDarkBackground }
625
+ max = { max }
607
626
maxLength = { maxLength }
627
+ min = { min }
608
628
name = { name }
609
629
onBlur = { this . onInputBlur }
610
630
onChange = { this . onChange }
611
631
onFocus = { this . onInputFocus }
612
632
onKeyPress = { this . onKeyPress }
613
633
placeholder = { placeholder }
614
634
readOnly = { isReadOnly }
635
+ step = { step }
615
636
type = { type }
616
637
value = { value }
617
638
/>
0 commit comments