Skip to content

Commit

Permalink
feat: keyboard navigation filter item (#5667)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwasniew authored Dec 18, 2023
1 parent 5ba588f commit 6bf54a2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
}));

Expand Down
5 changes: 5 additions & 0 deletions frontend/src/component/filter/FilterItem/FilterItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6bf54a2

Please sign in to comment.