fix: document history navigation

This commit is contained in:
Apoorv Mishra committed 2024-06-12 17:38:19 +05:30
1 parent f9d5fabb92
commit d7238ef817
1 file changed
+5 -15
+5 -15
View File
@@ -44,7 +44,10 @@ const ListItem = (
}
const [tabIndex, focused, handleKeyDown, handleClick, handleFocus] =
useRovingTabIndex(itemRef as React.RefObject<HTMLAnchorElement>, false);
useRovingTabIndex(
itemRef as React.RefObject<HTMLAnchorElement>,
to ? false : true
);
useFocusEffect(focused, itemRef as React.RefObject<HTMLAnchorElement>);
@@ -99,20 +102,7 @@ const ListItem = (
}
return (
<Wrapper
ref={itemRef}
$border={border}
$small={small}
{...rest}
tabIndex={tabIndex}
onKeyDown={handleKeyDown}
onClick={(ev) => {
if (rest.onClick) {
rest.onClick(ev);
}
handleClick();
}}
>
<Wrapper ref={itemRef} $border={border} $small={small} {...rest}>
{content(false)}
</Wrapper>
);