docs: improve sidebar items custom props docs (#8888)

This commit is contained in:
Sébastien Lorber 2023-04-13 11:24:27 +01:00 committed by GitHub
parent 35183d7d87
commit 14586895ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 42 additions and 20 deletions

View file

@ -46,8 +46,12 @@ function APITableRow(
id={id}
tabIndex={0}
ref={history.location.hash === anchor ? ref : undefined}
onClick={() => {
history.push(anchor);
onClick={(e) => {
const isLinkClick =
(e.target as HTMLElement).tagName.toUpperCase() === 'A';
if (!isLinkClick) {
history.push(anchor);
}
}}
onKeyDown={(e: React.KeyboardEvent) => {
if (e.key === 'Enter') {