From 4fd3b86fe4bc9f328148edc2353faee9f1053aa4 Mon Sep 17 00:00:00 2001 From: alimpens Date: Fri, 23 Aug 2024 15:12:45 +0200 Subject: [PATCH] chore: Remove unnecessary 'autocapitalize' attribute --- packages/css/src/components/password-input/README.md | 2 +- packages/css/src/components/text-input/README.md | 2 +- packages/react/src/PasswordInput/PasswordInput.test.tsx | 3 +-- packages/react/src/PasswordInput/PasswordInput.tsx | 1 - storybook/src/components/TextInput/TextInput.docs.mdx | 4 ++-- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/packages/css/src/components/password-input/README.md b/packages/css/src/components/password-input/README.md index afe1f37891..8dcd5a2273 100644 --- a/packages/css/src/components/password-input/README.md +++ b/packages/css/src/components/password-input/README.md @@ -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. diff --git a/packages/css/src/components/text-input/README.md b/packages/css/src/components/text-input/README.md index dd52c5c0ad..d63da5379f 100644 --- a/packages/css/src/components/text-input/README.md +++ b/packages/css/src/components/text-input/README.md @@ -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. diff --git a/packages/react/src/PasswordInput/PasswordInput.test.tsx b/packages/react/src/PasswordInput/PasswordInput.test.tsx index d66760b0b0..61124d0cda 100644 --- a/packages/react/src/PasswordInput/PasswordInput.test.tsx +++ b/packages/react/src/PasswordInput/PasswordInput.test.tsx @@ -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() const component = container.querySelector(':only-child') - expect(component).toHaveAttribute('autocapitalize', 'none') expect(component).toHaveAttribute('autocorrect', 'off') expect(component).toHaveAttribute('spellcheck', 'false') }) diff --git a/packages/react/src/PasswordInput/PasswordInput.tsx b/packages/react/src/PasswordInput/PasswordInput.tsx index 3df1d9095c..dc4ccd6039 100644 --- a/packages/react/src/PasswordInput/PasswordInput.tsx +++ b/packages/react/src/PasswordInput/PasswordInput.tsx @@ -20,7 +20,6 @@ export const PasswordInput = forwardRef(