mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-05 05:07:14 +02:00
fix(v2): classic theme - semantic correct anchors links (#5080)
* fix(v2): semantic correct anchors * chore: ignore linting
This commit is contained in:
parent
c3127b65d1
commit
823b020c34
2 changed files with 4 additions and 2 deletions
|
@ -128,6 +128,7 @@ function DocSidebarItemCategory({
|
||||||
className={clsx('menu__list-item', {
|
className={clsx('menu__list-item', {
|
||||||
'menu__list-item--collapsed': collapsed,
|
'menu__list-item--collapsed': collapsed,
|
||||||
})}>
|
})}>
|
||||||
|
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
||||||
<a
|
<a
|
||||||
className={clsx('menu__link', {
|
className={clsx('menu__link', {
|
||||||
'menu__link--sublist': collapsible,
|
'menu__link--sublist': collapsible,
|
||||||
|
@ -135,7 +136,7 @@ function DocSidebarItemCategory({
|
||||||
[styles.menuLinkText]: !collapsible,
|
[styles.menuLinkText]: !collapsible,
|
||||||
})}
|
})}
|
||||||
onClick={collapsible ? handleItemClick : undefined}
|
onClick={collapsible ? handleItemClick : undefined}
|
||||||
href={collapsible ? '#!' : undefined}
|
href={collapsible ? '#' : undefined}
|
||||||
{...props}>
|
{...props}>
|
||||||
{label}
|
{label}
|
||||||
</a>
|
</a>
|
||||||
|
|
|
@ -41,7 +41,8 @@ function SkipToContent(): JSX.Element {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div ref={containerRef}>
|
<div ref={containerRef}>
|
||||||
<a href="#main" className={styles.skipToContent} onClick={handleSkip}>
|
{/* eslint-disable-next-line jsx-a11y/anchor-is-valid */}
|
||||||
|
<a href="#" className={styles.skipToContent} onClick={handleSkip}>
|
||||||
<Translate
|
<Translate
|
||||||
id="theme.common.skipToMainContent"
|
id="theme.common.skipToMainContent"
|
||||||
description="The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation">
|
description="The skip to content label used for accessibility, allowing to rapidly navigate to main content with keyboard tab/enter navigation">
|
||||||
|
|
Loading…
Add table
Reference in a new issue