Skip to content

Commit

Permalink
Fix search form error state being invisible ❌
Browse files Browse the repository at this point in the history
  • Loading branch information
wotschofsky committed Dec 9, 2024
1 parent ef71a15 commit af0bb3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions app/_components/search-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -326,10 +326,8 @@ export const SearchForm: FC<SearchFormProps> = (props) => {
<Input
ref={inputRef}
name="domain"
className={cn('w-full !pl-9', {
'focus-visible:ring-destructive [&:not(:focus-visible)]:border-destructive':
isInvalid,
})}
className="w-full !pl-9"
data-invalid={isInvalid ? '' : undefined}
type="text"
required
autoComplete="off"
Expand Down
2 changes: 1 addition & 1 deletion components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
'relative block w-full',
'before:absolute before:inset-px before:rounded-[calc(theme(borderRadius.lg)-1px)] before:bg-white before:shadow',
'dark:before:hidden',
'after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:ring-inset after:ring-transparent sm:after:focus-within:ring-2 sm:after:focus-within:ring-blue-500',
'after:pointer-events-none after:absolute after:inset-0 after:rounded-lg after:ring-inset after:ring-transparent sm:after:focus-within:ring-2 sm:after:focus-within:ring-blue-500 sm:after:focus-within:has-[[data-invalid]]:ring-red-500',
'has-[[data-disabled]]:opacity-50 before:has-[[data-disabled]]:bg-zinc-950/5 before:has-[[data-disabled]]:shadow-none',
'before:has-[[data-invalid]]:shadow-red-500/10',
])}
Expand Down

0 comments on commit af0bb3d

Please sign in to comment.