Angular webclient navbar doesn't work with keyboard navigation

Bug #1828468 reported by Jane Sandberg
26
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Medium
Unassigned

Bug Description

In the Angular webclient navbar, the menus (e.g. Cataloging, Booking, Search) are not focusable. The entries within those menus are all <a>s with href attributes, which focus just fine. Unfortunately, keyboard users can't get to them, since they can't focus and expand the menus themselves. :-(

Revision history for this message
Jane Sandberg (sandbergja) wrote :

It might also be nice to be able to use the left and right arrows to move between menus.

Revision history for this message
Lynn Floyd (lfloyd) wrote :

The menu also does not allow you to collapse a menu to go backwards and forwards through the menu system.

Once you open them menus, there is not a way to close them to move on.

Changed in evergreen:
status: New → Confirmed
Revision history for this message
Galen Charlton (gmc) wrote :

Updating to ng-bootstrap 4.1.0 or later should help with this, as that adds the ngbDropdownItem directive to specify that a dropdown menu item should be keyboard navigable.

Revision history for this message
Stephanie Leary (stephanieleary) wrote :

Patch to enable keyboard navigation and up/down arrow movement as well as the tab key in submenus: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sleary/keyboard-nav

tags: added: pullrequest
Revision history for this message
Stephanie Leary (stephanieleary) wrote :

I've updated this working branch to fix keyboard navigation for the search result pagination links as well as the main menu.

Andrea Neiman (aneiman)
Changed in evergreen:
milestone: none → 3.10-beta
importance: Undecided → Medium
Galen Charlton (gmc)
Changed in evergreen:
milestone: 3.10-beta → none
tags: removed: pullrequest
Revision history for this message
Stephanie Leary (stephanieleary) wrote :

I'm removing the commit relating to pagination and will file a separate bug for that. This branch contains only the fix for the main navigation menu:
https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sleary/lp1828468-top-nav-tabindex

tags: added: pullrequest
Revision history for this message
Stephanie Leary (stephanieleary) wrote :

Rebased for bug squashing.

Revision history for this message
Jane Sandberg (sandbergja) wrote :

Thanks for the patch, Stephanie. +1 to getting the navbar into the <nav> landmark. The a.ngbdropdowntoggle elements are definitely in the focus order now, but I can't seem to activate them with the enter key. In other words, I can tab to, say, Acquisitions, but when I press enter, it doesn't expand the Acquisitions menu.

tags: added: needswork
tags: removed: pullrequest
Revision history for this message
Stephanie Leary (stephanieleary) wrote :

I've just updated the branch. The commit message includes testing instructions, since Bootstrap's keyboard support for dropdowns is a little sparse--closing a submenu could be better, for example. I think we could improve on it, but this provides the basics.

tags: added: pullrequest
removed: needswork
Revision history for this message
Galen Charlton (gmc) wrote :

A couple observations upon initial review of the patch:

- Overall, it's working well for me
- Because of code drift, the "Circulation (Experimental)" menu now needs the same markup changes
- Nitpick: the highlighting when the Cataloging -> Retrieve Last Bib Record menu item has focus is different from the other menu items

Also, a note for anybody else who test this: the proposed patch is _only_ for the Angular navbar; if you've got an AngularJS interface up, the navbar won't let you expand the top-level menus by keyboard action alone.

tags: added: needswork
Andrea Neiman (aneiman)
Changed in evergreen:
milestone: none → 3.next
Revision history for this message
Terran McCanna (tmccanna) wrote :

Removing pullrequest pending changes in comment #10. I personally wouldn't have a problem if the AngularJS navbar fixes were pushed to another new bug in order to go ahead and get these Angular changes committed.

tags: removed: pullrequest
Revision history for this message
Stephanie Leary (stephanieleary) wrote :

Revised branch here: https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/sleary/lp1828468-top-nav-revised

This is still Angular only, and uses the built-in Bootstrap dropdown keyboard functionality, which isn't entirely complete.

To recap what is and is not supported:

* You should be able to use the Tab key to move between the top-level menu items. The left/right arrow keys will not work here.
* Pressing Enter, Space, or the down arrow on a top-level item should open its submenu. Pressing Esc will close it. (Up arrow will not, which I find frustrating.)
* You can also shift-tab from the first submenu item back to the top level, and use Enter or Space to toggle the button again and close the submenu.
* Within the submenu, you can use either Tab and shift-Tab to move up and down, or the up/down arrow keys.
* Both buttons (e.g. Retrieve Last Bib Record) and links should be highlighted the same way.

We can add additional key events if we want, but we'll have to write them.

I had hoped to get the submenus marked up as unordered lists, which would add a little context for screen reader users, but I can't get the keyboard directives working when there are other elements in between the menu and the menu items. I'll file a bug with ng-Bootstrap about it.

tags: added: pullrequest
removed: needswork
Andrea Neiman (aneiman)
Changed in evergreen:
milestone: 3.next → 3.11-beta
Revision history for this message
Terran McCanna (tmccanna) wrote :

I'm getting multiple conflicts when I try to apply this to current master.

tags: added: needsrebase
Revision history for this message
Stephanie Leary (stephanieleary) wrote :

Rebased. Thanks, Terran!

tags: removed: needsrebase
Revision history for this message
Blake GH (bmagic) wrote :

Merge conflict today (feedback fest)

Revision history for this message
Stephanie Leary (stephanieleary) wrote :

Rebased just now; should be up to date with the max patron conditionals added in bug 1901072.

Michele Morgan (mmorgan)
Changed in evergreen:
assignee: nobody → Michele Morgan (mmorgan)
Revision history for this message
Michele Morgan (mmorgan) wrote :

This looks good to me. I'm adding my signoff along with a release note pulled from Stephanie's comments. Branch is here:

https://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/mmorgan/lp1828468_angular_navbar_keyboard_navigation_signoff

user/mmorgan/lp1828468_angular_navbar_keyboard_navigation_signoff

tags: added: signedoff
Changed in evergreen:
assignee: Michele Morgan (mmorgan) → nobody
Galen Charlton (gmc)
Changed in evergreen:
assignee: nobody → Galen Charlton (gmc)
Revision history for this message
Galen Charlton (gmc) wrote :

Pushed down to rel_3_11. Thanks, Stephanie and Michele!

Changed in evergreen:
assignee: Galen Charlton (gmc) → nobody
status: Confirmed → Fix Committed
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.