File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -196,13 +196,14 @@ export const SearchBar = <T extends SelectOptionRequired>({
196196 }
197197 />
198198 ) }
199- { clearable && selectedValues . length > 0 && ! loading && ! disabled && (
199+ { clearable && selectedValues . length > 0 && ! loading && (
200200 < ClearButton
201201 id = "clear"
202202 variant = "ghost_icon"
203203 onClick = { handleOnClear }
204204 data-testid = "clearBtn"
205205 $rightPadding = { mode === 'menu' }
206+ disabled = { disabled }
206207 >
207208 < Icon data = { clear } size = { 18 } />
208209 </ ClearButton >
Original file line number Diff line number Diff line change @@ -217,6 +217,11 @@ const ClearButton = styled(Button)<ClearButtonProps>`
217217 height: 24px;
218218 left: 0;
219219 }
220+ &:disabled {
221+ svg {
222+ fill: ${ colors . interactive . disabled__text . rgba } ;
223+ }
224+ }
220225` ;
221226
222227interface ComboBoxChipProps {
Original file line number Diff line number Diff line change @@ -87,14 +87,16 @@ type CommonListSelectProps<T extends SelectOptionRequired> = {
8787 groups ?: undefined ;
8888} ;
8989
90- interface ListSelectWithAddItemProps < T extends SelectOptionRequired >
91- extends CommonListSelectProps < T > {
90+ interface ListSelectWithAddItemProps <
91+ T extends SelectOptionRequired ,
92+ > extends CommonListSelectProps < T > {
9293 onAddItem : ( item : string ) => void ;
9394 itemSingularWord ?: string ;
9495}
9596
96- interface ListSelectWithoutAddItemProps < T extends SelectOptionRequired >
97- extends CommonListSelectProps < T > {
97+ interface ListSelectWithoutAddItemProps <
98+ T extends SelectOptionRequired ,
99+ > extends CommonListSelectProps < T > {
98100 onAddItem ?: undefined ;
99101 itemSingularWord ?: undefined ;
100102}
Original file line number Diff line number Diff line change @@ -275,8 +275,8 @@ export const DisabledSingleSelect: Story = {
275275 await step ( 'Verify that the select is disabled' , ( ) => {
276276 expect ( canvas . getByRole ( 'combobox' ) ) . toBeDisabled ( ) ;
277277 } ) ;
278- await step ( 'Verify that the clear button is not rendered ' , ( ) => {
279- expect ( canvas . queryByTestId ( 'clearBtn' ) ) . not . toBeInTheDocument ( ) ;
278+ await step ( 'Verify that the clear button is disabled ' , ( ) => {
279+ expect ( canvas . getByTestId ( 'clearBtn' ) ) . toBeDisabled ( ) ;
280280 } ) ;
281281 } ,
282282} ;
You can’t perform that action at this time.
0 commit comments