azavea/pwd-unitybar

Search control tabbing behavior

Closed this issue · 2 comments

We should make sure the search control behaves as follows.

  • When collapsed:
    • Tabbing into the search control expands it and focuses on the search input field.
  • When expanded:
    • Tabbing (or shift-tabbing) from the empty search input field collapses the search control and moves focus to the next (or previous) element in the DOM after (or before) the search control.
    • Tabbing (or shift-tabbing) from the non-empty search input field keeps the search control expanded and moves focus to the search button (or the previous element in the DOM before the search control).
    • Tabbing (or shift-tabbing) from the search button keeps the search control expanded and moves focus to the next (or previous) element in the DOM. (Note this assumes the search input field is non-empty, since focus shouldn't be able to reach the search button while the search input is empty.

Q: Should the map/help/custom elements get tabIndex -1 when the search bar's expanded?

As things are currently set up they currently are focusable even when they're hidden by the searchbar:

screen shot 2017-09-13 at 3 43 57 pm

Good catch. I think you're right. Those elements should get tabindex="-1" while obscured by the expanded search control. The user will need to clear the search field (and blur it) to reenable them.