Refactoring

Signed-off-by: Ivona Josipovic <josipovic.ivona@gmail.com>
This commit is contained in:
Ivona Josipovic
2023-11-09 09:34:45 +01:00
parent e07570a740
commit 28767a3d8a
2 changed files with 8 additions and 9 deletions
+1 -1
View File
@@ -2,4 +2,4 @@
'@backstage/core-components': patch
---
Fixed bug in Select component where a broken filter was showing when an invalid initialState was passed.
Fixed `Select` component default filter state.
@@ -218,21 +218,20 @@ export function SelectComponent(props: SelectProps) {
renderValue={s =>
multiple && (value as any[]).length !== 0 ? (
<Box className={classes.chips}>
{(s as string[]).map(selectedValue =>
items.find(el => el.value === selectedValue) ? (
{(s as string[]).map(selectedValue => {
const item = items.find(el => el.value === selectedValue);
return item ? (
<Chip
key={items.find(el => el.value === selectedValue)?.value}
label={
items.find(el => el.value === selectedValue)?.label
}
key={item?.value}
label={item?.label}
clickable
onDelete={handleDelete(selectedValue)}
className={classes.chip}
/>
) : (
false
),
)}
);
})}
</Box>
) : (
<Typography>