Skip to content

Commit

Permalink
TextInput: Add autoComplete to Storybook/docs (#5051)
Browse files Browse the repository at this point in the history
* Add `autoComplete` to docs, story

* add a comma
  • Loading branch information
TylerJDev authored Sep 30, 2024
1 parent d1d911a commit 1612131
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/react/src/TextInput/TextInput.docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@
"name": "aria-label",
"type": "string",
"defaultValue": "",
"description": "Allows input to be accessible."
"description": "Gives the input an accessible name."
},
{
"name": "autoComplete",
"type": "string",
"defaultValue": "",
"description": "Allows input to autofill based on value given."
},
{
"name": "block",
Expand Down
13 changes: 13 additions & 0 deletions packages/react/src/TextInput/TextInput.features.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -294,3 +294,16 @@ WithLoadingIndicator.parameters = {
exclude: [...textInputExcludedControlKeys, 'loaderPosition', ...Object.keys(formControlArgTypes), 'children'],
},
}

export const WithAutocompleteAttribute = () => (
<Box as="form">
<FormControl>
<FormControl.Label>First name</FormControl.Label>
<TextInput autoComplete="given-name" />
</FormControl>
<FormControl>
<FormControl.Label>Last name</FormControl.Label>
<TextInput autoComplete="family-name" />
</FormControl>
</Box>
)

0 comments on commit 1612131

Please sign in to comment.