Add option to prevent Input field caching (#1240)

This commit is contained in:
Abhinav Kumar 2023-07-11 12:34:53 +05:30 committed by GitHub
commit 96decde4ed
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 0 deletions

View file

@ -30,6 +30,7 @@ export interface SingleInputFormProps {
autoComplete?: string; autoComplete?: string;
blockButton?: boolean; blockButton?: boolean;
hiddenLabel?: boolean; hiddenLabel?: boolean;
disableAutoComplete?: boolean;
} }
export default function SingleInputForm(props: SingleInputFormProps) { export default function SingleInputForm(props: SingleInputFormProps) {
@ -109,6 +110,11 @@ export default function SingleInputForm(props: SingleInputFormProps) {
autoFocus={!props.disableAutoFocus} autoFocus={!props.disableAutoFocus}
autoComplete={props.autoComplete} autoComplete={props.autoComplete}
InputProps={{ InputProps={{
autoComplete:
props.disableAutoComplete ||
props.fieldType === 'password'
? 'off'
: 'on',
endAdornment: props.fieldType === 'password' && ( endAdornment: props.fieldType === 'password' && (
<ShowHidePassword <ShowHidePassword
showPassword={showPassword} showPassword={showPassword}

View file

@ -105,6 +105,7 @@ export default function Recover() {
fieldType="text" fieldType="text"
placeholder={t('RECOVERY_KEY_HINT')} placeholder={t('RECOVERY_KEY_HINT')}
buttonText={t('RECOVER')} buttonText={t('RECOVER')}
disableAutoComplete
/> />
<FormPaperFooter style={{ justifyContent: 'space-between' }}> <FormPaperFooter style={{ justifyContent: 'space-between' }}>
<LinkButton onClick={showNoRecoveryKeyMessage}> <LinkButton onClick={showNoRecoveryKeyMessage}>

View file

@ -152,6 +152,7 @@ export default function Recover() {
fieldType="text" fieldType="text"
placeholder={t('RECOVERY_KEY_HINT')} placeholder={t('RECOVERY_KEY_HINT')}
buttonText={t('RECOVER')} buttonText={t('RECOVER')}
disableAutoComplete
/> />
<FormPaperFooter style={{ justifyContent: 'space-between' }}> <FormPaperFooter style={{ justifyContent: 'space-between' }}>
<LinkButton onClick={() => showContactSupportDialog()}> <LinkButton onClick={() => showContactSupportDialog()}>