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] - DropdownItem using href replaces <li> with <a>, accessibility issue #4507

Open
Micueb opened this issue Jan 7, 2025 · 2 comments
Open
Assignees
Labels
♿ Scope : Accessibility Related to accessibility 🐛 Type: Bug Something isn't working

Comments

@Micueb
Copy link

Micueb commented Jan 7, 2025

NextUI Version

2.4.8

Describe the bug

On using href on a DropdownItem turns the item from a <li> into an <a>, which breaks accessibility.
I need to have links inside my dropdown leading to external pages.

<DropdownItem key="dashboard">Dashboard</DropdownItem>
<DropdownItem key="settings" href="www.faq-url.com">External FAQ</DropdownItem>
<DropdownItem key="new_project" endContent={<PlusIcon className="text-large" />}>
            New Project
</DropdownItem>

results in:
image

Your Example Website or App

No response

Steps to Reproduce the Bug or Issue

  1. Create dropdown component
  2. Add serveral items
  3. Add href to one of the items
  4. <li> of that item turns into <a>

Expected behavior

As a user I expect that <ul> only contains <li>

Screenshots or Videos

No response

Operating System Version

macOs

Browser

Chrome

Copy link

linear bot commented Jan 7, 2025

@wingkwong
Copy link
Member

@macci001 The previous PR got reverted due to the layout breaking and onClick issue. Please follow up.

@wingkwong wingkwong added 🐛 Type: Bug Something isn't working ♿ Scope : Accessibility Related to accessibility labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
♿ Scope : Accessibility Related to accessibility 🐛 Type: Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants