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
3 changes: 2 additions & 1 deletion src/molecules/Select/SearchBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -196,13 +196,14 @@ export const SearchBar = <T extends SelectOptionRequired>({
}
/>
)}
{clearable && selectedValues.length > 0 && !loading && !disabled && (
{clearable && selectedValues.length > 0 && !loading && (
<ClearButton
id="clear"
variant="ghost_icon"
onClick={handleOnClear}
data-testid="clearBtn"
$rightPadding={mode === 'menu'}
disabled={disabled}
>
<Icon data={clear} size={18} />
</ClearButton>
Comment thread
mariush2 marked this conversation as resolved.
Expand Down
5 changes: 5 additions & 0 deletions src/molecules/Select/Select.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ const ClearButton = styled(Button)<ClearButtonProps>`
height: 24px;
left: 0;
}
&:disabled {
svg {
fill: ${colors.interactive.disabled__text.rgba};
}
}
`;

interface ComboBoxChipProps {
Expand Down
10 changes: 6 additions & 4 deletions src/molecules/Select/Select.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,16 @@ type CommonListSelectProps<T extends SelectOptionRequired> = {
groups?: undefined;
};

interface ListSelectWithAddItemProps<T extends SelectOptionRequired>
extends CommonListSelectProps<T> {
interface ListSelectWithAddItemProps<
T extends SelectOptionRequired,
> extends CommonListSelectProps<T> {
onAddItem: (item: string) => void;
itemSingularWord?: string;
}

interface ListSelectWithoutAddItemProps<T extends SelectOptionRequired>
extends CommonListSelectProps<T> {
interface ListSelectWithoutAddItemProps<
T extends SelectOptionRequired,
> extends CommonListSelectProps<T> {
onAddItem?: undefined;
itemSingularWord?: undefined;
}
Expand Down
4 changes: 2 additions & 2 deletions src/molecules/Select/SingleSelect/SingleSelect.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -275,8 +275,8 @@ export const DisabledSingleSelect: Story = {
await step('Verify that the select is disabled', () => {
expect(canvas.getByRole('combobox')).toBeDisabled();
});
await step('Verify that the clear button is not rendered', () => {
expect(canvas.queryByTestId('clearBtn')).not.toBeInTheDocument();
await step('Verify that the clear button is disabled', () => {
expect(canvas.getByTestId('clearBtn')).toBeDisabled();
});
},
};
Loading