Skip to content

Commit

Permalink
chore: Remove unnecessary 'autocapitalize' attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
alimpens committed Aug 23, 2024
1 parent bc05258 commit 4fd3b86
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion packages/css/src/components/password-input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Helps users enter a password.
It ensures that the input is not readable by others who might be looking at the screen.
- The characters entered are hidden, represented by squares.

This component sets `autocapitalize="none"`, `autocorrect="off"` and `spellcheck="false"` to stop browsers automatically changing user input.
This component sets `autocorrect="off"` and `spellcheck="false"` to stop browsers automatically changing user input.
Passwords shouldn’t be checked for spelling or grammar.
This may also prevent posting the password to third-party plugins.
These props cannot be overridden.
Expand Down
2 changes: 1 addition & 1 deletion packages/css/src/components/text-input/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ A form field in which a user can enter text.
- Do not use a Text Input when users could provide more than 1 sentence of text.
- The width of the Text Input should be appropriate for the information to be entered.
- A Text Input must have a Label, and in most cases, this label should be visible.
- Use `spellcheck="false"` for fields that may contain sensitive information, such as passwords and personal data.
- Use `spellcheck="false"` for fields that may contain sensitive information, such as personal data.
Some browser extensions for spell-checking send this information to external servers.
- Apply automatic assistance where possible.
For example, in logged-in systems, pre-filling known values can prevent errors and save time.
3 changes: 1 addition & 2 deletions packages/react/src/PasswordInput/PasswordInput.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ describe('Password input', () => {
expect(component).toHaveClass('ams-password-input extra')
})

it('renders three attributes for privacy', () => {
it('renders two attributes for privacy', () => {
const { container } = render(<PasswordInput />)

const component = container.querySelector(':only-child')

expect(component).toHaveAttribute('autocapitalize', 'none')
expect(component).toHaveAttribute('autocorrect', 'off')
expect(component).toHaveAttribute('spellcheck', 'false')
})
Expand Down
1 change: 0 additions & 1 deletion packages/react/src/PasswordInput/PasswordInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export const PasswordInput = forwardRef(
<input
{...restProps}
aria-invalid={invalid || undefined}
autoCapitalize="none"
autoCorrect="off"
className={clsx('ams-password-input', className)}
dir={dir ?? 'auto'}
Expand Down
4 changes: 2 additions & 2 deletions storybook/src/components/TextInput/TextInput.docs.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ On some devices, it may show an email-specific keyboard.
Consider setting the following attributes:

1. Set `autocomplete="email"` to help browsers autofill the user’s email address.
2. Set `autocapitalize="none"`, `autocorrect="off"` and `spellcheck="false"` to stop browsers automatically changing user input.
2. Set `autocorrect="off"` and `spellcheck="false"` to stop browsers automatically changing user input.
Email addresses shouldn’t be checked for spelling or grammar.
This may also prevent posting the email address to third-party plugins.

Expand All @@ -46,7 +46,7 @@ On some devices, it may show a URL-specific keyboard to aid in entering web addr
Consider setting the following attributes:

1. Set `autocomplete="url"` to help browsers autofill the user’s web address.
2. Set `autocapitalize="none"`, `autocorrect="off"` and `spellcheck="false"` to stop browsers automatically changing user input.
2. Set `autocorrect="off"` and `spellcheck="false"` to stop browsers automatically changing user input.
Email addresses shouldn’t be checked for spelling or grammar.
This may also prevent posting the web address to third-party plugins.

Expand Down

0 comments on commit 4fd3b86

Please sign in to comment.