Skip to content

Commit

Permalink
fix(ui): reset higlighted action on keyboard navigation (#32051)
Browse files Browse the repository at this point in the history
Closes #32050

When keyboarding through the action view, the UI continues showing the
hovered action. This makes keyboard nav hard to use.

The fix is to reset the higlighted action on keyboard navigation. This
is what we do when the mouse pointer leaves an action, and what I think
is reasonable.
  • Loading branch information
Skn0tt authored Aug 8, 2024
1 parent 3d2b5e6 commit 17bb36a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/trace-viewer/src/ui/workbench.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,9 @@ export const Workbench: React.FunctionComponent<{

const onActionSelected = React.useCallback((action: modelUtil.ActionTraceEventInContext) => {
setSelectedAction(action);
setHighlightedAction(undefined);
onSelectionChanged?.(action);
}, [setSelectedAction, onSelectionChanged]);
}, [setSelectedAction, onSelectionChanged, setHighlightedAction]);

const selectPropertiesTab = React.useCallback((tab: string) => {
setSelectedPropertiesTab(tab);
Expand Down
1 change: 1 addition & 0 deletions packages/web/src/components/listView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ export function ListView<T>({
scrollIntoViewIfNeeded(element || undefined);
onHighlighted?.(undefined);
onSelected?.(items[newIndex], newIndex);
setHighlightedItem(undefined);
}}
ref={itemListRef}
>
Expand Down

0 comments on commit 17bb36a

Please sign in to comment.