Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(a11y): autocomplete on known fields #6116

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React, { useState, useRef } from 'react';
import { StyleSheet, Text, View } from 'react-native';
import { StyleSheet, Text, TextInputProps, View } from 'react-native';

import { CustomIcon, TIconsName } from '../../CustomIcon';
import i18n from '../../../i18n';
Expand Down Expand Up @@ -85,7 +85,8 @@ const ActionSheetContentWithInputAndSubmit = ({
confirmBackgroundColor,
showInput = true,
inputs = [],
isDisabled
isDisabled,
autoComplete = undefined
}: {
onSubmit: (inputValue: string | string[]) => void;
onCancel?: () => void;
Expand All @@ -102,6 +103,7 @@ const ActionSheetContentWithInputAndSubmit = ({
showInput?: boolean;
inputs?: { placeholder: string; secureTextEntry?: boolean; key: string }[];
isDisabled?: (inputValues: string[]) => boolean;
autoComplete?: TextInputProps['autoComplete'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't get it.
You did it on ActionSheetContentWithInputAndSubmit, but I search for <ActionSheetContentWithInputAndSubmit and there's no autoComplete prop added anywhere.
Is it done on another PR?

}): React.ReactElement => {
const { colors } = useTheme();
const [inputValues, setInputValues] = useState(inputs.map(() => ''));
Expand Down Expand Up @@ -151,6 +153,7 @@ const ActionSheetContentWithInputAndSubmit = ({
if (inputValues[0]) onSubmit(inputValues[0]);
}}
accessibilityLabel={placeholder}
autoComplete={autoComplete}
testID={`${testID}-input`}
secureTextEntry={secureTextEntry}
bottomSheet={isIOS}
Expand Down
2 changes: 1 addition & 1 deletion app/views/E2EEnterYourPasswordView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const E2EEnterYourPasswordView = (): React.ReactElement => {
onSubmitEditing={submit}
onChangeText={setPassword}
testID='e2e-enter-your-password-view-password'
textContentType='password'
autoComplete='password'
containerStyle={{ marginBottom: 0 }}
/>
<Button
Expand Down
3 changes: 3 additions & 0 deletions app/views/ProfileView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ class ProfileView extends React.Component<IProfileViewProps, IProfileViewState>
inputRef={e => (this.name = e)}
label={I18n.t('Name')}
placeholder={I18n.t('Name')}
autoComplete='name'
value={name}
onChangeText={(value: string) => this.setState({ name: value })}
onSubmitEditing={() => {
Expand All @@ -465,6 +466,7 @@ class ProfileView extends React.Component<IProfileViewProps, IProfileViewState>
inputRef={e => (this.username = e)}
label={I18n.t('Username')}
placeholder={I18n.t('Username')}
autoComplete='email'
value={username}
onChangeText={value => this.setState({ username: value })}
onSubmitEditing={() => {
Expand Down Expand Up @@ -519,6 +521,7 @@ class ProfileView extends React.Component<IProfileViewProps, IProfileViewState>
inputRef={e => (this.newPassword = e)}
label={I18n.t('New_Password')}
placeholder={I18n.t('New_Password')}
autoComplete='password-new'
value={newPassword || undefined}
onChangeText={value => this.setState({ newPassword: value })}
onSubmitEditing={() => {
Expand Down
1 change: 1 addition & 0 deletions app/views/RoomInfoEditView/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -595,6 +595,7 @@ class RoomInfoEditView extends React.Component<IRoomInfoEditViewProps, IRoomInfo
onChangeText={value => this.setState({ joinCode: value })}
secureTextEntry
testID='room-info-edit-view-password'
autoComplete='password'
/>
<View style={styles.switches}>
<SwitchContainer
Expand Down