Skip to content
This repository was archived by the owner on Mar 1, 2024. It is now read-only.

Commit 9e3272e

Browse files
authored
Merge pull request #386 from nating/input-validation
feat(FormInput): add validation properties
2 parents f50d1dd + 0a96d28 commit 9e3272e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/components/Form/FormInput.react.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,14 @@ type FormStyle = {|
2828
+placeholder?: string,
2929
+name?: string,
3030
+value?: string | number,
31+
+min?: string | number,
32+
+max?: string | number,
33+
+minlength?: string | number,
34+
+maxlength?: string | number,
3135
+disabled?: boolean,
3236
+readOnly?: boolean,
3337
+autoFocus?: boolean,
38+
+required?: boolean,
3439
+checked?: boolean,
3540
|};
3641

@@ -67,6 +72,10 @@ function FormInput(props: Props): React.Node {
6772
error,
6873
placeholder,
6974
value,
75+
min,
76+
max,
77+
minlength,
78+
maxlength,
7079
checked,
7180
onChange,
7281
onMouseEnter,
@@ -84,6 +93,7 @@ function FormInput(props: Props): React.Node {
8493
disabled,
8594
readOnly,
8695
autoFocus,
96+
required,
8797
label,
8898
} = props;
8999
const type = props.type || "text";
@@ -108,9 +118,14 @@ function FormInput(props: Props): React.Node {
108118
type,
109119
placeholder,
110120
value,
121+
min,
122+
max,
123+
minlength,
124+
maxlength,
111125
disabled,
112126
readOnly,
113127
autoFocus,
128+
required,
114129
onChange,
115130
onMouseEnter,
116131
onMouseLeave,

0 commit comments

Comments
 (0)