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

Commit

Permalink
Merge branch 'master' of github.com:tabler/tabler-react into form-aut…
Browse files Browse the repository at this point in the history
…ocomplete
  • Loading branch information
AaronCoplan committed Nov 30, 2018
2 parents cb9d5b6 + 788e80b commit dd06981
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion example/src/SiteWrapper.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type Props = {|
|};

type State = {|
+unreadCount: number,
unreadCount: number,
|};

type subNavItem = {|
Expand Down
10 changes: 5 additions & 5 deletions src/components/Form/Form.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export type Props = {|
+className?: string,
+action?: string,
+method?: string,
+autocomplete?: "on" | "off",
+autocomplete: "on" | "off",
|};

function Form({
Expand All @@ -48,10 +48,6 @@ function Form({
onSubmit,
autocomplete,
}: Props): React.Node {
// default for autocomplete is "off" if not passed in explicitly
if (!autocomplete) {
autocomplete = "off";
}
const classes = cn(className);
return (
<form
Expand All @@ -66,6 +62,10 @@ function Form({
);
}

Form.defaultProps = {
autocomplete: 'off',
};

Form.Group = FormGroup;
Form.Label = FormLabel;
Form.Input = FormInput;
Expand Down
3 changes: 3 additions & 0 deletions src/components/Form/FormInput.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ type FormStyle = {|
+value?: string | number,
+disabled?: boolean,
+readOnly?: boolean,
+autoFocus?: boolean,
+checked?: boolean,
|};

Expand Down Expand Up @@ -82,6 +83,7 @@ function FormInput(props: Props): React.Node {
onPaste,
disabled,
readOnly,
autoFocus,
label,
} = props;
const type = props.type || "text";
Expand All @@ -108,6 +110,7 @@ function FormInput(props: Props): React.Node {
value,
disabled,
readOnly,
autoFocus,
onChange,
onMouseEnter,
onMouseLeave,
Expand Down

0 comments on commit dd06981

Please sign in to comment.