Skip to content

Commit

Permalink
[TextField] Remove disable1Password prop (#10744)
Browse files Browse the repository at this point in the history
Removes the deprecated `disable1Password` prop.


### 🎩 checklist

- [x] Tested on
[mobile](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting.md#cross-browser-testing)
- [x] Tested on [multiple
browsers](https://help.shopify.com/en/manual/shopify-admin/supported-browsers)
- [x] Tested for
[accessibility](https://github.com/Shopify/polaris/blob/main/documentation/Accessibility%20testing.md)
- [x] Updated the component's `README.md` with documentation changes
- [x] [Tophatted
documentation](https://github.com/Shopify/polaris/blob/main/documentation/Tophatting%20documentation.md)
changes in the style guide

---------

Co-authored-by: Jess Telford <jess.telford@shopify.com>
  • Loading branch information
mrcthms and jesstelford committed Sep 29, 2023
1 parent a95ed6c commit a4f5e7d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 24 deletions.
5 changes: 5 additions & 0 deletions .changeset/fifty-wombats-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/polaris': major
---

Removed deprecated `disable1Password` prop from `TextField`.
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ export function CreateViewModal({
)
: undefined
}
disable1Password
/>
</div>
</FormLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -882,7 +882,6 @@ export function With1PasswordDisabled() {
value={value}
onChange={handleChange}
autoComplete="off"
disable1Password
/>
);
}
8 changes: 1 addition & 7 deletions polaris-react/src/components/TextField/TextField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -175,11 +175,6 @@ interface NonMutuallyExclusiveProps {
onFocus?: (event?: React.FocusEvent) => void;
/** Callback fired when input is blurred */
onBlur?(event?: React.FocusEvent): void;
/**
* @deprecated Turning off 1Password and LastPass password manager autofill is done automatically when `autocomplete` is set to `off`.
* Disables the 1password extension on the text field.
*/
disable1Password?: boolean;
}

export type MutuallyExclusiveSelectionProps =
Expand Down Expand Up @@ -246,7 +241,6 @@ export function TextField({
onSpinnerChange,
onFocus,
onBlur,
disable1Password,
}: TextFieldProps) {
const i18n = useI18n();
const [height, setHeight] = useState<number | null>(null);
Expand Down Expand Up @@ -565,7 +559,7 @@ export function TextField({
onChange: !suggestion ? handleChange : undefined,
onInput: suggestion ? handleChange : undefined,
// 1Password disable data attribute
'data-1p-ignore': autoComplete === 'off' || disable1Password || undefined,
'data-1p-ignore': autoComplete === 'off' || undefined,
// LastPass disable data attribute
'data-lpignore': autoComplete === 'off' || undefined,
// Dashlane disable data attribute
Expand Down
15 changes: 0 additions & 15 deletions polaris-react/src/components/TextField/tests/TextField.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,6 @@ describe('<TextField />', () => {
});
});

it('adds the 1Password disable prop if disable1Password is set', () => {
const textField = mountWithApp(
<TextField
label="TextField"
onChange={noop}
autoComplete="off"
disable1Password
/>,
);

expect(textField).toContainReactComponent('input', {
'data-1p-ignore': true,
} as any);
});

it('adds the password manager disabled props if autoComplete="off" is set', () => {
const textField = mountWithApp(
<TextField label="TextField" onChange={noop} autoComplete="off" />,
Expand Down

0 comments on commit a4f5e7d

Please sign in to comment.