layer5 icon indicating copy to clipboard operation
layer5 copied to clipboard

Navbar accessibility for keyboard users

Open Olaleye-Blessing opened this issue 2 years ago • 9 comments

Current Behavior Keyboard users can't access the dropdown menu on the navbar. They can only be accessed when they are hover.

Desired Behavior They should have have access to those drop down menus.


Screenshots / Mockups

The dropdown menu is only available to mouse users.

Screenshot (430)_LI

Alternatives


Contributor Resources

The layer5.io website uses Gatsby, React, and GitHub Pages. Site content is found under the master branch.

Olaleye-Blessing avatar Apr 28 '22 17:04 Olaleye-Blessing

Confirmed. This is an accessibility issue. Do you have a proposed solution, @Olaleye-Blessing? tabindex?

leecalcote avatar Apr 28 '22 19:04 leecalcote

I'm not really sure if this is going to work since the hover state is achieved through Javascript.

Checking ScrollspyMenu that displays the content, I think we can call wrapDisplay that displays the submenu when either the nav link is focused or any or its sublink.

A possible solution could look like this:

Have a parent ref for line 42.

const ulRef = useRef(null);

check if any inner sibling is focused add onFocus to parent ul: line 42.

function onFocus() { const ul = ulRef.current; const isChildFocused= ul.contains(document.activeElement); // checks if any child is focused if(isChildFocused) wrapDisplay(); }

wrapNone removes the submenu

add onBlur to the last submenu item so as to call wrapNone

function onBlurred() { wrapNone() }

I'll like to make a pull request.

Olaleye-Blessing avatar Apr 29 '22 01:04 Olaleye-Blessing

I tried the above solution which I proposed but it's not working. There's just a flash of the dropdown menus when the first menu is focused. Someone else can work on it pending the time I figure it out.

Olaleye-Blessing avatar May 07 '22 19:05 Olaleye-Blessing

@Olaleye-Blessing @leecalcote I would love to work on this issue, can I take this up :)

Palaksharma23 avatar May 29 '22 02:05 Palaksharma23

Sounds great, @Palaksharma23

leecalcote avatar May 29 '22 04:05 leecalcote

@Palaksharma23 Any updates on this?

adithyaakrishna avatar Jun 14 '22 18:06 adithyaakrishna

I got a little busy @adithyaakrishna, I will do it now!

Palaksharma23 avatar Jul 15 '22 15:07 Palaksharma23

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 20 '22 17:09 stale[bot]

Checking in... it has been awhile since we've heard from you on this issue. Are you still working on it? Please let us know and please don't hesitate to contact a MeshMate or any other community member for assistance.


        Be sure to join the community, if you haven't yet and please leave a :star: star on the project :smile:

github-actions[bot] avatar Sep 20 '22 18:09 github-actions[bot]

We can live with the accessibility, no need for this much granularity.

Nikhil-Ladha avatar Sep 30 '22 05:09 Nikhil-Ladha