Skip to content

Commit

Permalink
BUGFIX: fix onClear on SearchInput.tsx (#3828)
Browse files Browse the repository at this point in the history
Co-authored-by: Sebastian Sebald <sebastian.sebald@gmail.com>
  • Loading branch information
aromko and sebald committed Mar 14, 2024
1 parent f6a7035 commit f996764
Show file tree
Hide file tree
Showing 4 changed files with 135 additions and 551 deletions.
5 changes: 5 additions & 0 deletions .changeset/beige-kangaroos-brush.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@marigold/components": patch
---

BUGFIX: fix onClear on SearchInput.tsx
2 changes: 1 addition & 1 deletion packages/components/src/Autocomplete/Autocomplete.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ test('renders an input', () => {
</Autocomplete>
);

const textField = screen.getByLabelText('vegetables');
const textField = screen.getByRole('combobox');
expect(textField).toBeInTheDocument();
expect(textField).toHaveAttribute('type', 'search');
expect(textField instanceof HTMLInputElement).toBeTruthy();
Expand Down
4 changes: 1 addition & 3 deletions packages/components/src/Input/SearchInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { useLocalizedStringFormatter } from '@react-aria/i18n';

import { cn } from '@marigold/system';

import { Input } from './Input';
import type { InputProps } from './Input';
import { Input } from './Input';

const intlMessages = {
'de-DE': {
Expand Down Expand Up @@ -65,8 +65,6 @@ export const SearchInput = forwardRef<HTMLInputElement, SearchInputProps>(
<Button
className={className?.action}
onPress={() => onClear?.()}
// Don't inherit default Button behavior from ComboBox + broken types
slot={null as any}
aria-label={stringFormatter.format('Clear search')}
excludeFromTabOrder={true}
// @ts-ignore
Expand Down

0 comments on commit f996764

Please sign in to comment.