Bug 517008 - Dialogs, drop menus and drop sections should trap focus while traversing with tab key
Summary: Dialogs, drop menus and drop sections should trap focus while traversing with...
Status: NEW
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Client (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Eric Moffatt CLA
QA Contact:
URL:
Whiteboard:
Keywords: accessibility
Depends on:
Blocks:
 
Reported: 2017-05-19 14:04 EDT by Silenio Quarti CLA
Modified: 2017-10-19 17:10 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Silenio Quarti CLA 2017-05-19 14:04:09 EDT
Open the wrench menu, put focus on it and start tabbing, the focus can leave the drop down.

This also happens in the git page dropdown (i.e References) and in the edit page menus.

There are two options to fix this:

1) we can trap the focus in the drop down
2) we can dismiss the drop down
Comment 1 Eric Moffatt CLA 2017-05-24 13:58:21 EDT
The handling needs to be done by trapping the 'blur' on the last element within the 'dialog'...

Car and I have determined that we'll take two different approaches based on the 'type' of the container being traversed:

1) Menus / Dropdowns (File/Edit... and Help etc) will *not* trap the focus but instead move to the next tabbable (NOTE: we need to also have Arrow key navigation in place for the menu structure to allow this).

2) Dialogs (things that go away on ESC but contain 'controls' (text fields, buttons, checkboxes...) *will* trap the Tab until ESC is hit.
Comment 2 Carolyn MacLeod CLA 2017-05-24 18:30:38 EDT
> The handling needs to be done by trapping the 'blur' on the last element within the 'dialog'...

Also on the first element when using shift+tab to traverse backwards.

> 2) Dialogs (things that go away on ESC but contain 'controls' (text fields, buttons, checkboxes...) *will* trap the Tab until ESC is hit.

Yep. We also agreed that mouse click will still close the 'dialog'.

There's a "tooltip dialog" pattern that is being reviewed/rewritten for the ARIA Practices Guide that may have some useful info.

Discussion is here: https://github.com/w3c/aria-practices/issues/85

The old guidance is here: https://rawgit.com/w3c/aria-practices/master/aria-practices-DeletedSectionsArchive.html#dialog_tooltip

And the old examples page is here: http://archive.dojotoolkit.org/nightly/dojotoolkit/dijit/tests/test_TooltipDialog.html

If we end up using any of this and have anything interesting to contribute back, I am sure they would welcome the input.
Comment 3 Eric Moffatt CLA 2017-05-26 15:05:05 EDT
I'm in the process of tracking down and fixing these.

Things to look out for in the code review:

1) I'm not sure whether the changes in 'section.js' should be inside the if that checks if the firstTabbable is an INPUT (i.e. I added the code to fix the Repository and Reference dropdowns but I' afraid of interferring with sections that aren't in dropdowns).

I've avoided making the changes in dialog.js since *some* of these dialogs work OK but others don't.

The OpenResource dialog correctly traps tabs if it's opened with previous results but *only* until new search results come in, then it's busted.
Comment 4 Eric Moffatt CLA 2017-05-26 15:10:53 EDT
I"ve created a branch 'emoffatt/DialogTabTrap' for this work but have yet to push the first instance...
Comment 5 Eric Moffatt CLA 2017-05-26 15:34:01 EDT
Note that for many of the parameter mini-dialogs like adding a new Git Repository fro the edit page the ESC only works when the focus is in the default input field...
Comment 6 Eclipse Genie CLA 2017-05-30 15:45:50 EDT
GitHub Pull Request 37 created by [emoffatt]
https://github.com/eclipse/orion.client/pull/37
Comment 7 Carolyn MacLeod CLA 2017-05-31 10:18:55 EDT
For what it's worth, the "inert" attribute could/would/should be a useful improvement to our modal dialog focus handling "someday": https://twitter.com/rob_dodson/status/868296999375847424

And/or we could use this inert polyfill (scroll down to read the README.md): https://github.com/wicg/inert

This is because modals are tricky to get right for all users (keyboard, mouse, screen reader...): https://robdodson.me/building-better-accessibility-primitives/
Comment 8 Carolyn MacLeod CLA 2017-06-02 17:03:46 EDT
Can this be closed now?