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

Commit

Permalink
Merge pull request #386 from nating/input-validation
Browse files Browse the repository at this point in the history
feat(FormInput): add validation properties
  • Loading branch information
AaronCoplan committed Jan 29, 2019
2 parents f50d1dd + 0a96d28 commit 9e3272e
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/components/Form/FormInput.react.js
Expand Up @@ -28,9 +28,14 @@ type FormStyle = {|
+placeholder?: string,
+name?: string,
+value?: string | number,
+min?: string | number,
+max?: string | number,
+minlength?: string | number,
+maxlength?: string | number,
+disabled?: boolean,
+readOnly?: boolean,
+autoFocus?: boolean,
+required?: boolean,
+checked?: boolean,
|};

Expand Down Expand Up @@ -67,6 +72,10 @@ function FormInput(props: Props): React.Node {
error,
placeholder,
value,
min,
max,
minlength,
maxlength,
checked,
onChange,
onMouseEnter,
Expand All @@ -84,6 +93,7 @@ function FormInput(props: Props): React.Node {
disabled,
readOnly,
autoFocus,
required,
label,
} = props;
const type = props.type || "text";
Expand All @@ -108,9 +118,14 @@ function FormInput(props: Props): React.Node {
type,
placeholder,
value,
min,
max,
minlength,
maxlength,
disabled,
readOnly,
autoFocus,
required,
onChange,
onMouseEnter,
onMouseLeave,
Expand Down

0 comments on commit 9e3272e

Please sign in to comment.