fix(ui): reset higlighted action on keyboard navigation (#32051)
Closes https://github.com/microsoft/playwright/issues/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.
This commit is contained in:
parent
3d2b5e6801
commit
17bb36a7fe
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -128,6 +128,7 @@ export function ListView<T>({
|
|||
scrollIntoViewIfNeeded(element || undefined);
|
||||
onHighlighted?.(undefined);
|
||||
onSelected?.(items[newIndex], newIndex);
|
||||
setHighlightedItem(undefined);
|
||||
}}
|
||||
ref={itemListRef}
|
||||
>
|
||||
|
|
|
|||
Loading…
Reference in a new issue