Skip to content

Commit

Permalink
Merge pull request #2673 from myxmaster/auto_focus_new_password_input
Browse files Browse the repository at this point in the history
Set password: Auto focus new password input
  • Loading branch information
kaloudis authored Dec 27, 2024
2 parents 3ce8f09 + 1e0d0a6 commit 5a0371d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions views/Settings/SetPassword.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ export default class SetPassphrase extends React.Component<
isBiometryEnabled: false
};

private firstInput = React.createRef<any>();

async componentDidMount() {
const { SettingsStore } = this.props;
const settings = await SettingsStore.getSettings();
Expand All @@ -58,6 +60,8 @@ export default class SetPassphrase extends React.Component<
if (settings.passphrase) {
this.setState({ savedPassphrase: settings.passphrase });
}

this.firstInput.current?.focus();
}

renderSeparator = () => (
Expand Down Expand Up @@ -176,6 +180,7 @@ export default class SetPassphrase extends React.Component<
{localeString('views.Settings.newPassword')}
</Text>
<TextInput
ref={this.firstInput}
placeholder={'********'}
placeholderTextColor="darkgray"
value={passphrase}
Expand Down

0 comments on commit 5a0371d

Please sign in to comment.