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 #374 from tabler/form-autocomplete
Browse files Browse the repository at this point in the history
Setting up autocomplete in Form
  • Loading branch information
AaronCoplan committed Dec 1, 2018
2 parents 1ed6736 + 4e9bcd4 commit a40997b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/components/Form/Form.react.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// @flow
import * as React from "react";
import cn from "classnames";

import FormGroup from "./FormGroup.react";
import FormLabel from "./FormLabel.react";
Expand Down Expand Up @@ -37,6 +36,7 @@ export type Props = {|
+className?: string,
+action?: string,
+method?: string,
+autocomplete: "on" | "off",
|};

function Form({
Expand All @@ -45,20 +45,25 @@ function Form({
action,
method,
onSubmit,
autocomplete,
}: Props): React.Node {
const classes = cn(className);
return (
<form
className={classes}
className={className}
onSubmit={onSubmit}
action={action}
method={method}
autocomplete={autocomplete}
>
{children}
</form>
);
}

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

Form.Group = FormGroup;
Form.Label = FormLabel;
Form.Input = FormInput;
Expand Down

0 comments on commit a40997b

Please sign in to comment.