Skip to content

Commit

Permalink
Add placeholder to search field
Browse files Browse the repository at this point in the history
  • Loading branch information
raix committed Jul 17, 2024
1 parent bdb3d11 commit d0d4698
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ui/components/SearchField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@ import { composeTailwindRenderProps } from "./utils";
export interface SearchFieldProps extends AriaSearchFieldProps {
label?: string;
description?: string;
placeholder?: string;
errorMessage?: string | ((validation: ValidationResult) => string);
}

export function SearchField({ label, description, errorMessage, ...props }: Readonly<SearchFieldProps>) {
export function SearchField({ label, description, errorMessage, placeholder, ...props }: Readonly<SearchFieldProps>) {
return (
<AriaSearchField
{...props}
Expand All @@ -33,7 +34,7 @@ export function SearchField({ label, description, errorMessage, ...props }: Read
aria-hidden
className="ml-2 h-4 w-4 text-muted-foreground group-disabled:opacity-50 forced-colors:text-[ButtonText] forced-colors:group-disabled:text-[GrayText]"
/>
<Input isEmbedded className="[&::-webkit-search-cancel-button]:hidden" />
<Input placeholder={placeholder} isEmbedded className="[&::-webkit-search-cancel-button]:hidden" />
<Button variant="ghost" size="icon" className="mr-1 w-6 group-empty:invisible">
<XIcon aria-hidden className="h-4 w-4" />
</Button>
Expand Down

0 comments on commit d0d4698

Please sign in to comment.