Remove elements from multiple-select type filters in <Table> component using X icon on chip

Signed-off-by: Fatih Camgoz <fatihcamgoz@hotmail.com.tr>
This commit is contained in:
Fatih Camgoz
2025-03-06 23:29:03 -05:00
parent c5172f5737
commit 9545af219b
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/core-components': minor
---
Declared CancelIcon explicitly on Chip component inside Select.tsx to disable onMouseDown event by default that creates the flaw of re-opening select component when user tries to remove a selected filter.
@@ -28,6 +28,7 @@ import {
withStyles,
} from '@material-ui/core/styles';
import Typography from '@material-ui/core/Typography';
import CancelIcon from '@material-ui/icons/Cancel';
import React, { useEffect, useState } from 'react';
import ClosedDropdown from './static/ClosedDropdown';
@@ -225,6 +226,11 @@ export function SelectComponent(props: SelectProps) {
key={item?.value}
label={item?.label}
clickable
deleteIcon={
<CancelIcon
onMouseDown={event => event.stopPropagation()}
/>
}
onDelete={handleDelete(selectedValue)}
className={classes.chip}
/>