Skip to content

fix(ui): merge caller className in PasswordInput via cn - #212

Merged
gkhngyk merged 1 commit into
ansvisor:mainfrom
MaitreyeeDeshmukh:fix/password-input-classname
Jun 9, 2026
Merged

gkhngyk merged 1 commit into
ansvisor:mainfrom
MaitreyeeDeshmukh:fix/password-input-classname

Conversation

@MaitreyeeDeshmukh

Copy link
Copy Markdown
Contributor

Summary

Fixes a bug in the PasswordInput component where a className passed by a caller was silently dropped instead of being merged.

Fixes #211
Follow-up to #210

Root cause

className="pr-10" was placed after {...props} on the Input element, so any className in props was overridden. No current caller passes a className so there is no visible bug today, but as a reusable ui/ component the first caller that needs an error style or aria-invalid class would silently lose it.

Change

  • Destructure className out of props in the function signature
  • Merge with cn('pr-10', className) so pr-10 is always applied as the base and the caller's class is appended
  • Place className before {...props} so the spread cannot override it

Acceptance criteria

  • A className passed to PasswordInput is merged with pr-10 (both applied), not dropped
  • The four existing auth forms render unchanged (none pass a className)
  • TypeScript: zero errors
  • Lint: zero new errors

- className="pr-10" placed after {...props} was silently dropping any
  className passed by callers since spread props were overridden
- destructure className from props and merge with cn('pr-10', className)
- pr-10 is always applied as the base; caller className is appended
- no behavior change for the four existing auth form callers (none pass className)

Fixes ansvisor#211
Follow-up to ansvisor#210
@gkhngyk
gkhngyk merged commit 50d54d9 into ansvisor:main Jun 9, 2026
2 checks passed
@gkhngyk

gkhngyk commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Merged — exactly the fix: cn('pr-10', className) with className pulled out of props so callers' classes are preserved. Clean follow-up, thanks again! 🙌

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.

fix(ui): PasswordInput drops caller-provided className

2 participants