Skip to content

fix(ui): PasswordInput drops caller-provided className #211

Closed

Description

@gkhngyk

What

PasswordInput (added in #210) hardcodes className="pr-10" after spreading {...props}, so a className passed by a caller is silently dropped instead of being merged.

web/src/components/ui/password-input.tsx:

<Input type={visible ? 'text' : 'password'} {...props} className="pr-10" />

Because className="pr-10" comes last, it overrides props.className. None of the current four callers pass a className, so there's no visible bug today — but it's a reusable ui/ component, so the first caller that needs e.g. an error / aria-invalid style will lose it.

Fix

Destructure className out of props and merge it with the base classes via cn:

import { cn } from '@/lib/utils';

export function PasswordInput({ className, ...props }: PasswordInputProps) {
  const [visible, setVisible] = useState(false);
  return (
    <div className="relative">
      <Input
        type={visible ? 'text' : 'password'}
        className={cn('pr-10', className)}
        {...props}
      />
      {/* ...toggle button unchanged... */}
    </div>
  );
}

Acceptance

  • A className passed to PasswordInput is merged with pr-10 (both applied), not dropped
  • The four existing auth forms render unchanged
  • No new TypeScript / lint errors

Notes

Activity

  1. added
    bug
    good first issue
    on Jun 9, 2026
  2. n1dhiparate commented on Jun 9, 2026

    @n1dhiparate
    Contributor

    Hi! I'd like to work on this issue if it's still available.

  3. MaitreyeeDeshmukh commented on Jun 9, 2026

    @MaitreyeeDeshmukh
    Contributor

    Hi! Opened a PR for this: #212. TypeScript and lint both pass clean.

  4. added a commit that references this issue on Jun 9, 2026
    50d54d9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buggood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions