Skip to content

fix(LoginForm): expose username and password autocomplete - #12644

Open
mnkprs wants to merge 1 commit into
patternfly:mainfrom
mnkprs:fix/login-form-autocomplete-12600
Open

fix(LoginForm): expose username and password autocomplete#12644
mnkprs wants to merge 1 commit into
patternfly:mainfrom
mnkprs:fix/login-form-autocomplete-12600

Conversation

@mnkprs

@mnkprs mnkprs commented Sep 8, 2026

Copy link
Copy Markdown

What: Closes #12600

Adds optional usernameAutoComplete and passwordAutoComplete props to LoginForm, allowing callers to set values such as username, current-password, and new-password on the individual inputs. Omitting the props preserves the existing behavior.

Updates the basic login example and documents both props. Regression tests cover field-specific values, form-level autocomplete, and showing/hiding the password.

Validation:

  • 110 related tests and 31 snapshots passed. Eight regression cases failed before the fix.
  • yarn build passed.
  • yarn lint:all passed with existing warnings in unchanged files.

Additional issues: None.

Summary by CodeRabbit

  • New Features

    • Login forms now support optional autocomplete settings for username and password fields.
    • Browser autocomplete is enabled in the basic login example for existing accounts.
  • Documentation

    • Added guidance for configuring autocomplete values, including existing-account and new-password scenarios.

@coderabbitai

coderabbitai Bot commented Sep 8, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 1b86220a-1dc8-4781-8071-7ece0885dcb7

📥 Commits

Reviewing files that changed from the base of the PR and between b73e9dd and 26e4851.

📒 Files selected for processing (4)
  • packages/react-core/src/components/LoginPage/LoginForm.tsx
  • packages/react-core/src/components/LoginPage/__tests__/LoginForm.test.tsx
  • packages/react-core/src/components/LoginPage/examples/LoginPage.md
  • packages/react-core/src/components/LoginPage/examples/LoginPageBasic.tsx

Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.


Walkthrough

LoginForm now exposes separate autocomplete props for username and password inputs. Tests validate default behavior, independent values, and password visibility changes. The basic example and documentation show autocomplete configuration.

Changes

LoginForm autocomplete support

Layer / File(s) Summary
Expose and forward autocomplete props
packages/react-core/src/components/LoginPage/LoginForm.tsx
LoginFormProps now includes optional usernameAutoComplete and passwordAutoComplete values. Each value is passed to its corresponding TextInput.
Validate examples and behavior
packages/react-core/src/components/LoginPage/__tests__/LoginForm.test.tsx, packages/react-core/src/components/LoginPage/examples/LoginPageBasic.tsx, packages/react-core/src/components/LoginPage/examples/LoginPage.md
Tests cover defaults, independent field values, form-level autocomplete, and password visibility changes. The example and documentation show supported autocomplete values.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 26e48

LoginForm now supports separate username and password autocomplete values without changing default input behavior. The documented examples and regression coverage support the intended behavior, with no current merge-blocking risk identified.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: exposing username and password autocomplete configuration on LoginForm.
Linked Issues check ✅ Passed The changes satisfy issue #12600 by adding optional usernameAutoComplete and passwordAutoComplete props for the username and password inputs. The implementation supports values such as current-passwor…
Out of Scope Changes check ✅ Passed The code, tests, example, and documentation changes directly support the autocomplete configuration objective. No unrelated changes are present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 3…
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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.

Bug - [LoginForm] - autoComplete is not exposed and cannot be defined in the LoginForm.

1 participant