Fix Lifecyce text-overlow issue in SearchFilter component.

Signed-off-by: Kenny Johnson <105308787+papercircuit@users.noreply.github.com>
This commit is contained in:
Kenny Johnson
2023-04-20 19:07:16 -04:00
committed by Renan Mendes Carvalho
parent 42d2d8c02d
commit 603ed96a25
@@ -37,6 +37,16 @@ const useStyles = makeStyles({
label: {
textTransform: 'capitalize',
},
checkboxWrapper: {
display: 'flex',
alignItems: 'center',
width: '100%',
},
textWrapper: {
overflow: 'hidden',
textOverflow: 'ellipsis',
whiteSpace: 'nowrap',
},
});
/**
@@ -120,17 +130,21 @@ export const CheckboxFilter = (props: SearchFilterComponentProps) => {
<FormControlLabel
key={value}
control={
<Checkbox
color="primary"
tabIndex={-1}
inputProps={{ 'aria-labelledby': value }}
value={value}
name={value}
onChange={handleChange}
checked={((filters[name] as string[]) ?? []).includes(value)}
/>
<div className={classes.checkboxWrapper}>
<Checkbox
color="primary"
tabIndex={-1}
inputProps={{ 'aria-labelledby': value }}
value={value}
name={value}
onChange={handleChange}
checked={((filters[name] as string[]) ?? []).includes(value)}
/>
<div className={classes.textWrapper}>
<span>{value}</span>
</div>
</div>
}
label={value}
/>
))}
</FormControl>
@@ -197,7 +211,7 @@ export const SelectFilter = (props: SearchFilterComponentProps) => {
</MenuItem>
{values.map((value: string) => (
<MenuItem key={value} value={value}>
{value}
<span>{value}</span>
</MenuItem>
))}
</Select>