cyntler / hamburger-react

Animated hamburger menu icons for React.js weighs only 1.5 KB.
https://hamburger-react.netlify.app
MIT License
963 stars 36 forks source link

aria-controls to beef up accessibility #69

Closed TheAce74 closed 6 months ago

TheAce74 commented 6 months ago

I've been using this package for a while and I've got no complaints; it's awesome 🔥

Would it be possible to add a controls prop to the hamburgers? It would provide more context to screen readers about the actual item the hamburger is controlling.

I've been working around this with this hack:

  useEffect(() => {
    const menu = document.querySelector(".hamburger-react");
    menu.setAttribute("aria-controls", "primary-navigation");
  }, []);

If it is possible, can I be assigned to the task?

cyntler commented 6 months ago

@TheAce74 Yes! I assigned the task to you!

TheAce74 commented 6 months ago

@cyntler Thank you, I'll start working on it as soon as I can

TheAce74 commented 6 months ago

@cyntler I just added this enhancement, please refer to #71 for more info.