Skip to content

Commit

Permalink
fix(GoalListItem): keyboard hover
Browse files Browse the repository at this point in the history
  • Loading branch information
asabotovich committed Feb 1, 2024
1 parent ab7ec21 commit 1a2da59
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/components/GoalListItem/GoalListItem.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
color: var(--text-secondary);
}

.Row:hover {
.Row_hovered, .Row:hover {
border: 1px solid var(--layer-border-hover);
background: var(--layer-hover);
}
Expand Down
5 changes: 3 additions & 2 deletions src/components/GoalListItem/GoalListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import s from './GoalListItem.module.css';

interface GoalListItemProps extends HTMLAttributes<HTMLDivElement> {
selected?: boolean;
hovered?: boolean;
className?: string;
onClick?: MouseEventHandler<HTMLElement>;
}

export const GoalListItem: FC<GoalListItemProps> = ({ children, selected, className, ...rest }) => {
export const GoalListItem: FC<GoalListItemProps> = ({ children, selected, hovered, className, ...rest }) => {
return (
<TableRow className={cn(s.Row, { [s.Row_selected]: selected }, className)} {...rest}>
<TableRow className={cn(s.Row, { [s.Row_selected]: selected, [s.Row_hovered]: hovered }, className)} {...rest}>
{children}
</TableRow>
);
Expand Down
3 changes: 2 additions & 1 deletion src/components/GoalTableList/GoalTableList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,8 @@ export const GoalTableList = <T extends Partial<NonNullable<GoalByIdReturnType>>
renderItem={({ active, hovered: _, ...props }) => (
<GoalListItem
onClick={onGoalPreviewShow(row.goal)}
selected={selectedGoalResolver?.(row.goal?.id as string) || active}
selected={selectedGoalResolver?.(row.goal?.id as string)}
hovered={active}
{...props}
>
{row.list.map(({ content, width, className }, index) => (
Expand Down

0 comments on commit 1a2da59

Please sign in to comment.