Skip to content

Commit

Permalink
Disable spellcheck for PII fields (saleor#2416)
Browse files Browse the repository at this point in the history
  • Loading branch information
krzysztofzuraw authored Oct 31, 2022
1 parent 8025247 commit cac3e43
Show file tree
Hide file tree
Showing 10 changed files with 237 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/auth/components/LoginPage/LoginPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {
value={data.email}
inputProps={{
"data-test-id": "email",
spellCheck: false,
}}
disabled={disabled}
/>
Expand All @@ -95,6 +96,7 @@ const LoginCard: React.FC<LoginCardProps> = props => {
value={data.password}
inputProps={{
"data-test-id": "password",
spellCheck: false,
}}
disabled={disabled}
/>
Expand Down
2 changes: 2 additions & 0 deletions src/auth/components/NewPasswordPage/NewPasswordPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ const NewPasswordPage: React.FC<NewPasswordPageProps> = props => {
value={data.password}
inputProps={{
"data-test-id": "password",
spellCheck: false,
}}
required
/>
Expand All @@ -102,6 +103,7 @@ const NewPasswordPage: React.FC<NewPasswordPageProps> = props => {
}
inputProps={{
"data-test-id": "confirm-password",
spellCheck: false,
}}
required
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ const ResetPasswordPage: React.FC<ResetPasswordPageProps> = props => {
value={data.email}
inputProps={{
"data-test-id": "email",
spellCheck: false,
}}
/>
<FormSpacer />
Expand Down
12 changes: 12 additions & 0 deletions src/components/AddressEdit/AddressEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ const AddressEdit: React.FC<AddressEditProps> = props => {
// Setting 'autoComplete: "new-password"' is the only way to
// disable Chrome's autofill on forms as of early 2022
autoComplete: "new-password",
spellCheck: false,
}}
/>
</div>
Expand All @@ -111,6 +112,7 @@ const AddressEdit: React.FC<AddressEditProps> = props => {
fullWidth
InputProps={{
autoComplete: "new-password",
spellCheck: false,
}}
/>
</div>
Expand All @@ -132,6 +134,7 @@ const AddressEdit: React.FC<AddressEditProps> = props => {
fullWidth
InputProps={{
autoComplete: "new-password",
spellCheck: false,
}}
/>
</div>
Expand All @@ -150,6 +153,7 @@ const AddressEdit: React.FC<AddressEditProps> = props => {
onChange={onChange}
InputProps={{
autoComplete: "new-password",
spellCheck: false,
}}
/>
</div>
Expand All @@ -169,6 +173,7 @@ const AddressEdit: React.FC<AddressEditProps> = props => {
fullWidth
InputProps={{
autoComplete: "new-password",
spellCheck: false,
}}
/>
<FormSpacer />
Expand All @@ -186,6 +191,7 @@ const AddressEdit: React.FC<AddressEditProps> = props => {
fullWidth
InputProps={{
autoComplete: "new-password",
spellCheck: false,
}}
/>
<FormSpacer />
Expand All @@ -205,6 +211,7 @@ const AddressEdit: React.FC<AddressEditProps> = props => {
fullWidth
InputProps={{
autoComplete: "new-password",
spellCheck: false,
}}
/>
</div>
Expand All @@ -223,6 +230,7 @@ const AddressEdit: React.FC<AddressEditProps> = props => {
fullWidth
InputProps={{
autoComplete: "new-password",
spellCheck: false,
}}
/>
</div>
Expand All @@ -245,6 +253,9 @@ const AddressEdit: React.FC<AddressEditProps> = props => {
onChange={onCountryChange}
value={data.country}
choices={countries}
InputProps={{
spellCheck: false,
}}
/>
</div>
<div>
Expand All @@ -262,6 +273,7 @@ const AddressEdit: React.FC<AddressEditProps> = props => {
fullWidth
InputProps={{
autoComplete: "new-password",
spellCheck: false,
}}
/>
</div>
Expand Down
10 changes: 10 additions & 0 deletions src/components/CompanyAddressInput/CompanyAddressForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ const CompanyAddressForm: React.FC<CompanyAddressFormProps> = props => {
fullWidth
InputProps={{
autoComplete: "organization",
spellCheck: false,
}}
/>
<FormSpacer />
Expand All @@ -112,6 +113,7 @@ const CompanyAddressForm: React.FC<CompanyAddressFormProps> = props => {
fullWidth
InputProps={{
autoComplete: "address-line1",
spellCheck: false,
}}
/>
<FormSpacer />
Expand All @@ -129,6 +131,7 @@ const CompanyAddressForm: React.FC<CompanyAddressFormProps> = props => {
fullWidth
InputProps={{
autoComplete: "address-line2",
spellCheck: false,
}}
/>
<FormSpacer />
Expand All @@ -147,6 +150,7 @@ const CompanyAddressForm: React.FC<CompanyAddressFormProps> = props => {
fullWidth
InputProps={{
autoComplete: "address-level2",
spellCheck: false,
}}
/>
<TextField
Expand All @@ -163,6 +167,7 @@ const CompanyAddressForm: React.FC<CompanyAddressFormProps> = props => {
fullWidth
InputProps={{
autoComplete: "postal-code",
spellCheck: false,
}}
/>
</Grid>
Expand All @@ -182,6 +187,9 @@ const CompanyAddressForm: React.FC<CompanyAddressFormProps> = props => {
onChange={onCountryChange}
value={data.country}
choices={countries}
InputProps={{
spellCheck: false,
}}
/>
<TextField
disabled={disabled}
Expand All @@ -197,6 +205,7 @@ const CompanyAddressForm: React.FC<CompanyAddressFormProps> = props => {
fullWidth
InputProps={{
autoComplete: "address-level1",
spellCheck: false,
}}
/>
</Grid>
Expand All @@ -215,6 +224,7 @@ const CompanyAddressForm: React.FC<CompanyAddressFormProps> = props => {
onChange={onChange}
InputProps={{
autoComplete: "tel",
spellCheck: false,
}}
/>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@ const CustomerCreateDetails: React.FC<CustomerCreateDetailsProps> = props => {
type="text"
value={data.customerFirstName}
onChange={onChange}
inputProps={{
spellCheck: false,
}}
/>
<TextField
disabled={disabled}
Expand All @@ -78,6 +81,9 @@ const CustomerCreateDetails: React.FC<CustomerCreateDetailsProps> = props => {
type="text"
value={data.customerLastName}
onChange={onChange}
inputProps={{
spellCheck: false,
}}
/>
<TextField
disabled={disabled}
Expand All @@ -89,6 +95,9 @@ const CustomerCreateDetails: React.FC<CustomerCreateDetailsProps> = props => {
type="email"
value={data.email}
onChange={onChange}
inputProps={{
spellCheck: false,
}}
/>
</div>
</CardContent>
Expand Down
9 changes: 9 additions & 0 deletions src/customers/components/CustomerInfo/CustomerInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ const CustomerInfo: React.FC<CustomerInfoProps> = props => {
label={intl.formatMessage(commonMessages.firstName)}
value={data.firstName}
onChange={onChange}
inputProps={{
spellCheck: false,
}}
/>
<TextField
disabled={disabled}
Expand All @@ -81,6 +84,9 @@ const CustomerInfo: React.FC<CustomerInfoProps> = props => {
label={intl.formatMessage(commonMessages.lastName)}
value={data.lastName}
onChange={onChange}
inputProps={{
spellCheck: false,
}}
/>
</Grid>
<Hr className={classes.hr} />
Expand All @@ -101,6 +107,9 @@ const CustomerInfo: React.FC<CustomerInfoProps> = props => {
label={intl.formatMessage(commonMessages.email)}
value={data.email}
onChange={onChange}
inputProps={{
spellCheck: false,
}}
/>
</CardContent>
</Card>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ const StaffPasswordResetDialog: React.FC<StaffPasswordResetDialogProps> = ({
name="oldPassword"
type="password"
onChange={change}
inputProps={{
spellCheck: false,
}}
/>
<FormSpacer />
<TextField
Expand All @@ -99,6 +102,9 @@ const StaffPasswordResetDialog: React.FC<StaffPasswordResetDialogProps> = ({
name="newPassword"
type="password"
onChange={change}
inputProps={{
spellCheck: false,
}}
/>
</DialogContent>
<DialogActions>
Expand Down
9 changes: 9 additions & 0 deletions src/staff/components/StaffProperties/StaffProperties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -212,20 +212,29 @@ const StaffProperties: React.FC<StaffPropertiesProps> = props => {
{...getFieldProps("firstName")}
onChange={onChange}
fullWidth
inputProps={{
spellCheck: false,
}}
/>
</div>
<div className={classes.prop}>
<TextField
{...getFieldProps("lastName")}
onChange={onChange}
fullWidth
inputProps={{
spellCheck: false,
}}
/>
</div>
<div className={classes.prop}>
<TextField
{...getFieldProps("email")}
onChange={onChange}
fullWidth
inputProps={{
spellCheck: false,
}}
/>
</div>
</div>
Expand Down
Loading

0 comments on commit cac3e43

Please sign in to comment.