Open timcosta opened 7 years ago
Using <a>
kind of works, but you'll also have to use href="#"
. But the styling is still off as that will cause the burger menu to appear in your link color, but that's easily fixed:
a.navbar-burger {
color: inherit;
}
Toggling then works with enter but not space when using a simple onClick event handler.
Is there a reason the docs currently provide an example of using <a>
without mentioning the need to overwrite the style? It caused me quite a bit of confusion.
I made an issue that uses ckeckbox with label for toggling functionality without need for any additional JavaScript and wonder if changing navbar-burger
to checkbox with label would work better for accessibility. Would like to hear your input on this matter.
You can check it out the issue here : #2500
I agree, this should be a button
.
Overview of the problem
This is about the Bulma CSS framework I'm using Bulma version [0.4.3] My browser is: Chrome 59 I am sure this issue is not a duplicate
Description
Currently,
navbar-burger
is show in the docs as adiv
, and is styled appropriately when implemented as adiv
. Unfortunately, this presents a problem when it comes to accessibility.div
elements are not inherently clickable, but can be made clickable by addingtabindex=0
. This allows browsers (Chrome at least) to focus thediv
, but keyboard click events such as theenter
key orspace
key do no trigger click events ondiv
s. As such, thenavbar-burger
is not currently web accessible.Steps to Reproduce
navbar
as described in docstabindex="0"
to burgerspace
orenter
navbar-menu
doesnt togglebutton
Expected behavior
navbar-burger
should be styled appropriately as a button, asnavbar-burger
is a toggle button that modifies the state of the current page, not ana
that changes the URL or navigates you, and not adiv
that isnt focusable for accessibility.Actual behavior
div
isnt accessible, when implemented as a button the styling is off