1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00

feat: keyboard navigation filter item (#5667)

This commit is contained in:
Mateusz Kwasniewski 2023-12-18 12:36:00 +01:00 committed by GitHub
parent 5ba588f59a
commit 6bf54a2f24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -11,8 +11,9 @@ export const StyledDropdown = styled('div')(({ theme }) => ({
export const StyledListItem = styled(ListItem)(({ theme }) => ({
paddingLeft: theme.spacing(1),
cursor: 'pointer',
'&:hover': {
'&:hover, &:focus': {
backgroundColor: theme.palette.action.hover,
outline: 'none',
},
}));

View File

@ -9,6 +9,7 @@ import {
StyledTextField,
} from './FilterItem.styles';
import { FilterItemChip } from './FilterItemChip/FilterItemChip';
import { onEnter } from '../../common/Search/SearchSuggestions/onEnter';
export interface IFilterItemProps {
name: string;
@ -159,6 +160,10 @@ export const FilterItem: FC<IFilterItemProps> = ({
key={option.value}
dense
disablePadding
tabIndex={0}
onKeyDown={onEnter(
handleToggle(option.value),
)}
onClick={handleToggle(option.value)}
>
<StyledCheckbox