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

[a11y] Navbar.Link > Navbar.Dropdown can't be focused using the keyboard #383

Open
FunctionDJ opened this issue Apr 2, 2022 · 0 comments
Labels

Comments

@FunctionDJ
Copy link

FunctionDJ commented Apr 2, 2022

Describe the bug
Title pretty much says it all. The Navbar.Dropdown component doesn't contain a <a> so it's not focuseable.

See official component viewer: https://couds.github.io/react-bulma-components/?path=/story/components-navbar--default

I've explored a few approaches between making the element focuseable using tabindex but then it still can't be triggered using the keyboard.

The correct solution would be to use the appropriate element for what the Navbar.Link should behave like: renderAs="button"
This fixes basically all usability and accessibility issues, but unfortunately the browser default stylesheet bleeds through and makes the button look very ugly with a white background, border, changed font etc.

So instead of mopping that up with a lot more code i decided to use renderAs="a" with href="#" + event.preventDefault().
This is not ideal though. Optimally react-bulma-components would use a <button> in this case and apply the same styles and suppress the browser default styles.

It would be awesome if this component library can be made more accessible and keyboard friendly :)

@FunctionDJ FunctionDJ added the bug label Apr 2, 2022
@FunctionDJ FunctionDJ changed the title Navbar.Link > Navbar.Dropdown can't be focused using the keyboard (accessibility issue) [a11y] Navbar.Link > Navbar.Dropdown can't be focused using the keyboard Apr 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant