Skip to content

Fix autofocus issue on Login Update Password screen#776

Open
netalkGB wants to merge 1 commit intokeycloakify:mainfrom
netalkGB:fix-input-focus
Open

Fix autofocus issue on Login Update Password screen#776
netalkGB wants to merge 1 commit intokeycloakify:mainfrom
netalkGB:fix-input-focus

Conversation

@netalkGB
Copy link
Copy Markdown

Fix autofocus issue on Login Update Password screen

Bug

On the LoginUpdatePassword screen, the focus is currently set on the second input field (Confirm Password) instead of the first one (New Password).
This behavior is incorrect because the user should first enter a new password before confirming it.

Fix

  • Updated LoginUpdatePassword.tsx to ensure that the first input field (New Password) receives focus.
  • The issue was caused by both input fields having the autofocus attribute. According to MDN, the autofocus attribute should only be assigned to one element per document.
  • The official Keycloak template in FTL format also applies the autofocus attribute only to the first input field:

Before Fix (Screenshot)

Screenshot from 2025-01-31 01-46-19

After Fix (Screenshot)

Screenshot from 2025-01-31 02-00-05

This change improves the user experience by ensuring the expected input flow.
I would appreciate it if you could review this change and consider merging it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant