Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions packages/apollo-wind/src/components/ui/search.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ describe('Search', () => {
expect(input).toHaveClass('custom-search');
});

it('suppresses the native search clear button to avoid a duplicate', () => {
render(<Search value="test" onChange={vi.fn()} />);
const input = screen.getByRole('searchbox');
expect(input).toHaveClass('[&::-webkit-search-cancel-button]:appearance-none');
expect(input).toHaveClass('[&::-webkit-search-decoration]:appearance-none');
});

it('forwards ref correctly', () => {
const ref = { current: null };
render(<Search ref={ref} />);
Expand Down
5 changes: 4 additions & 1 deletion packages/apollo-wind/src/components/ui/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,10 @@ const Search = React.forwardRef<HTMLInputElement, SearchProps>(
<InputGroupInput
ref={ref}
type="search"
className={className}
className={cn(
'[&::-webkit-search-cancel-button]:appearance-none [&::-webkit-search-decoration]:appearance-none',
className
)}
Comment thread
david-rios-uipath marked this conversation as resolved.
value={value}
onChange={(e) => onChange?.(e.target.value)}
{...props}
Expand Down
Loading