From 2c5ae3a26714c5985e8dfb973cae1695a4c392cf Mon Sep 17 00:00:00 2001 From: UjjawalPrabhat Date: Wed, 26 Nov 2025 01:54:08 +0530 Subject: [PATCH 1/3] (fix) O3-5243: Restore browser autofill support for login credentials - Render both username and password inputs in DOM on initial load - Hide password field visually using CSS (not display:none) until user continues - Add proper name and autocomplete attributes for browser autofill - Maintain accessibility with aria-hidden and tabIndex management - Preserve existing two-step login UX - Add tests verifying DOM presence and autofill attributes Fixes regression where browser credential autofill stopped working after PR #104 --- .../src/login/login.component.tsx | 44 +++++++----- .../apps/esm-login-app/src/login/login.scss | 12 ++++ .../esm-login-app/src/login/login.test.tsx | 71 ++++++++++++++++++- 3 files changed, 108 insertions(+), 19 deletions(-) diff --git a/packages/apps/esm-login-app/src/login/login.component.tsx b/packages/apps/esm-login-app/src/login/login.component.tsx index 4dbb7f826..a314c3b0c 100644 --- a/packages/apps/esm-login-app/src/login/login.component.tsx +++ b/packages/apps/esm-login-app/src/login/login.component.tsx @@ -51,7 +51,10 @@ const Login: React.FC = () => { useEffect(() => { if (showPasswordOnSeparateScreen) { if (showPasswordField) { - passwordInputRef.current?.focus(); + // Only focus password input if it's empty (to preserve browser autofilled values) + if (!passwordInputRef.current?.value) { + passwordInputRef.current?.focus(); + } } else { usernameInputRef.current?.focus(); } @@ -157,6 +160,8 @@ const Login: React.FC = () => { { autoFocus /> {showPasswordOnSeparateScreen ? ( - showPasswordField ? ( - <> + <> + {/* Password input is always in DOM for browser autofill support, but visually hidden until username step is complete */} +
+
+ {showPasswordField ? ( - - ) : ( - - ) + ) : ( + + )} + ) : ( <>