Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: Keyboard Navigation Issues with gcds-nav-group Component #719

Open
3 tasks done
Garry-08 opened this issue Jan 3, 2025 · 0 comments
Open
3 tasks done

bug: Keyboard Navigation Issues with gcds-nav-group Component #719

Garry-08 opened this issue Jan 3, 2025 · 0 comments

Comments

@Garry-08
Copy link

Garry-08 commented Jan 3, 2025

Prerequisites | Prérequis

GC Design System Components Package and Version | Paquet et version des composants de Système de design GC

@cdssnc/gcds-components-vue, version 0.26.2

Current Behavior | Comportement observé

When using the gcds-nav-group component in a Nuxt. 3 app, keyboard navigation within dropdown menus malfunctions:

Premature Closure: When navigating using tab key and hit enter on the item to open, pressing Tab closes the dropdown ( items) unexpectedly, skipping child items.
Focus Issues: Focus does not loop correctly; Tab do not cycle through all dropdo
output
wn items.

Expected Behavior | Comportement attendu

When navigating to a navigation bar item () and pressing Enter, the dropdown menu () opens. Now, pressing the Tab key should navigate through the options within the dropdown but instead it closes the drop down. The dropdown should remain open until focus moves outside or the Escape key is pressed

System Info | Information sur le système

Browser: Chrome, Edge
Operating System: Windows 10
IDE: IntelliJ IDEA
Node.js Version: v20.12.2
npm Version: 10.5.0

Steps to Reproduce | Étapes pour reproduire le bogue

You can reproduce the issue by following the steps outlined in the Current Behavior section above.
Implementation Example:
Note: Initially, was used within , but replacing it with standard tags did not resolve the issue. Both approaches resulted in the same keyboard navigation problems.

  <gcds-nav-group
        :open-trigger="t('navigationBar.menu1.heading')"
        :menu-label="t('navigationBar.menu1.heading')"
      >
        <gcds-nav-link>
          <a href="/page1">{{ t('navigationBar.menu1.view') }}</a>
        </a>
        </gcds-nav-link>
        <gcds-nav-link>
          <a href="/page1/new">{{ t('navigationBar.menu1.add') }}</a>
        </a>
        </gcds-nav-link>
      </gcds-nav-group>

When Using Nuxt Link

<gcds-nav-group
  :open-trigger="t('navigationBar.menu1.heading')"
  :menu-label="t('navigationBar.menu1.heading')"
>
  <gcds-nav-link>
    <NuxtLink to="/page1">
      {{ t('navigationBar.menu1.view') }}
    </NuxtLink>
  </gcds-nav-link>
  <gcds-nav-link>
    <NuxtLink to="/page1/new">
      {{ t('navigationBar.menu1.add') }}
    </NuxtLink>
  </gcds-nav-link>
</gcds-nav-group>

Code Reproduction URL | URL de reproduction du code

No response

Additional Information | Informations supplémentaires

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant