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

Setting aria-expanded works when opening/closing but is reset when following a link #147

Open
sjnims opened this issue Aug 29, 2017 · 0 comments

Comments

@sjnims
Copy link

sjnims commented Aug 29, 2017

Version

v2.7.0

Description

Using Rails 5.1.2, Ruby 2.4.1, jQuery 3.2.1, and Bootstrap 3.3.7

I noticed what I believe to be odd behavior when inspecting the html of my project that is using metisMenu. Per the installation instructions step # 5, I've added aria-expanded=false to the a and following ul elements in the menu. I've observed that when opening & closing the menu, the metisMenu javascript is correctly changing the state of aria-expanded from false to true, and will continue to do so while opening/closing menus.

When I click a link in the menu, that page is rendered and metisMenu continues to work (hooray!). However, I was expecting the a and ul element of the link I just clicked to be marked as aria-expanded=true but in fact they are listed as aria-expanded=false.

Is this behavior expected, or should the plugin "remember" that those elements should be marked as true now that the link they contain was clicked and is the active page? If not, I think there may be a work-around using a Rails helper method (yet to be defined, something along the lines of aria-expanded?(link) that returns the truthiness of the link status).

Error message

No errors that I can discern

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