Skip to content

Commit

Permalink
Refactor authentication dialog in App component
Browse files Browse the repository at this point in the history
- Simplified password input handling by consolidating onChange and onKeyPress events.
- Updated the label for the password field to improve clarity.
- Added an ID attribute for the password input field for better accessibility. (bitwarden etc.)
  • Loading branch information
mbakgun committed Dec 14, 2024
1 parent ed31d6b commit 0597c90
Showing 1 changed file with 9 additions and 14 deletions.
23 changes: 9 additions & 14 deletions frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2448,25 +2448,20 @@ function App() {
</DialogTitle>
<DialogContent>
<TextField
autoFocus
margin="dense"
label="Master Password"
id="MASTER_PASSWORD"
type="password"
fullWidth
variant="outlined"
value={password}
onChange={(e) => {
setPassword(e.target.value);
setAuthError('');
}}
error={!!authError}
helperText={authError}
className={classes.authInput}
onKeyPress={(e) => {
if (e.key === 'Enter' && password) {
onChange={(e) => setPassword(e.target.value)}
onKeyDown={(e) => {
if (e.key === 'Enter') {
handleAuthentication();
}
}}
className={classes.authInput}
label="Password"
variant="outlined"
fullWidth
autoFocus
/>
</DialogContent>
<DialogActions>
Expand Down

0 comments on commit 0597c90

Please sign in to comment.