Skip to content

Commit

Permalink
Fixes accessibility issue in navigation (#4024)
Browse files Browse the repository at this point in the history
  • Loading branch information
walmazacn authored Nov 19, 2024
1 parent 274d7ab commit 44ec648
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 16 deletions.
20 changes: 5 additions & 15 deletions core/src/navigation/LeftNav.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,7 @@
{#each nodes as node}
{#if !node.hideFromNav}
{#if node.label}
<li class="fd-navigation__list-item lui-nav-entry" aria-hidden="true">
<li class="fd-navigation__list-item lui-nav-entry">
<div
class="fd-navigation__item"
aria-level="2"
Expand Down Expand Up @@ -729,7 +729,6 @@
{:else if nodes.filter((node) => !node.hideFromNav && node.label).length > 0}
<li
class="fd-navigation__list-item {isSemiCollapsed ? 'fd-popover' : ''} lui-nav-entry"
aria-hidden="true"
data-testid={getTestIdForCat(nodes.metaInfo, key)}
>
<!-- svelte-ignore a11y-click-events-have-key-events -->
Expand Down Expand Up @@ -794,7 +793,6 @@
<div
class="fd-navigation__list-wrapper
{isSemiCollapsed ? 'fd-popover__wrapper' : ''}"
aria-hidden="true"
>
{#if isSemiCollapsed}
<div
Expand Down Expand Up @@ -834,7 +832,7 @@
{#each nodes as node}
{#if !node.hideFromNav}
{#if node.label}
<li class="fd-navigation__list-item" aria-hidden="true">
<li class="fd-navigation__list-item">
<div
class="fd-navigation__item fd-navigation__item--child"
aria-level="3"
Expand Down Expand Up @@ -939,14 +937,8 @@
<li class="lui-spacer" role="presentation" aria-hidden="true" />
<li class="fd-navigation__list-item fd-navigation__list-item--overflow" aria-hidden="true">
<div
class="fd-navigation__item lui-nav-more"
aria-haspopup="menu"
role="menuitem"
aria-expanded="false"
tabindex="-1"
>
<li class="fd-navigation__list-item fd-navigation__list-item--overflow">
<div class="fd-navigation__item lui-nav-more" aria-haspopup="menu" role="menuitem" aria-expanded="false">
<!-- svelte-ignore a11y-missing-attribute -->
<!-- svelte-ignore a11y-click-events-have-key-events -->
<a
Expand Down Expand Up @@ -1021,9 +1013,7 @@
<div class="fd-side-nav__main-navigation">
{#if children && pathData.length > 0 && (pathData[0].topNav === false || pathData.length > 1)}
<div class="lui-fd-side-nav-wrapper">
<ul
class="fd-nested-list {sideNavCompactMode ? 'fd-nested-list fd-nested-list--compact' : 'fd-nested-list'}"
>
<ul class={sideNavCompactMode ? 'fd-nested-list fd-nested-list--compact' : 'fd-nested-list'}>
{#each sortedChildrenEntries as [key, nodes], index}
{#if key === 'undefined' || key.startsWith(virtualGroupPrefix)}
<!-- Single nodes -->
Expand Down
2 changes: 1 addition & 1 deletion core/src/navigation/LeftNavGroup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{#if navGroup.isSingleEntry}
<slot />
{:else}
<li class="fd-navigation__list-item" aria-hidden="true">
<li class="fd-navigation__list-item">
<div
class="fd-navigation__item fd-navigation__item--group"
aria-level="1"
Expand Down

0 comments on commit 44ec648

Please sign in to comment.