accessible-menu
accessible-menu copied to clipboard
Docs: Extend Top Link Disclosure example to include toggles for sub-submenus
Summary
The example codepen for the Top Link Disclosure Menu has separate elements for the top level link, and a toggle to display the submenu (which is the point of this demonstration as I understand it, and the thing I'm trying to implement in one of our menus).
However, this pattern is then not extended into to the submenu links themselves - despite the library apparently supporting this option via the submenuSubtoggleSelector
option.
Solution
Could the Top Link Disclosure example extend its use of toggles throughout the example?
Alternatives
If the default example shouldn't be extended in this way (doing so would make the name "Top link disclosure" someone inaccurate), could the body copy in the codepen be updated to include a reference to this feature for others to implement more easily?
Additional context
I should note that it took me only a few minutes of looking through the source code for this library to discover the needed parameter, and a bit of fiddling in a fork of the CodePen to confirm that the argument would solve the problem I was trying to address. As such, I don't think the existing documentation is broken.
This is also not a bug in the actual library (which I initially thought might be the case, until I looked through the source code and found the submenuSubtoggleSelector
argument in the constructor.
@matt-bernhardt thanks for the issue!
I’m hesitant to update the main codepen with this because it’s not a default for top-link disclosure menus (it was a call I had to make since the ARIA APG doesn’t show any examples of 3+ level menus).
That being said, I’d like to create a series of examples with customized features/advanced use cases and this would be a perfect entry.
I’ll look into starting that section of the documentation.