Merge pull request #21084 from iwarra/fix-broken-table-filter
Bug fix concerning the issue #20971
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/core-components': patch
|
||||
---
|
||||
|
||||
Fixed an issue causing the `Select` component to show empty chips when some of the selected values did not match any item
|
||||
@@ -218,15 +218,20 @@ export function SelectComponent(props: SelectProps) {
|
||||
renderValue={s =>
|
||||
multiple && (value as any[]).length !== 0 ? (
|
||||
<Box className={classes.chips}>
|
||||
{(s as string[]).map(selectedValue => (
|
||||
<Chip
|
||||
key={items.find(el => el.value === selectedValue)?.value}
|
||||
label={items.find(el => el.value === selectedValue)?.label}
|
||||
clickable
|
||||
onDelete={handleDelete(selectedValue)}
|
||||
className={classes.chip}
|
||||
/>
|
||||
))}
|
||||
{(s as string[]).map(selectedValue => {
|
||||
const item = items.find(el => el.value === selectedValue);
|
||||
return item ? (
|
||||
<Chip
|
||||
key={item?.value}
|
||||
label={item?.label}
|
||||
clickable
|
||||
onDelete={handleDelete(selectedValue)}
|
||||
className={classes.chip}
|
||||
/>
|
||||
) : (
|
||||
false
|
||||
);
|
||||
})}
|
||||
</Box>
|
||||
) : (
|
||||
<Typography>
|
||||
|
||||
Reference in New Issue
Block a user