Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug 1874968: Pressing escape key doesn't exit the dropdown list #6907

Merged

Conversation

harishsurf
Copy link
Contributor

Bug 1874968: Keyboard shortcut to exit dropdown doesn't work

Signed-off-by: Harish hgovinda@redhat.com

@openshift-ci-robot openshift-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. labels Oct 12, 2020
@openshift-ci-robot
Copy link
Contributor

@harishsurf: This pull request references Bugzilla bug 1874968, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.7.0) matches configured target release for branch (4.7.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

In response to this:

[WIP] Bug 1874968: Pressing escape key doesn't exit the dropdown list

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Oct 12, 2020
@openshift-ci-robot openshift-ci-robot added the component/core Related to console core functionality label Oct 12, 2020
Bug 1874968: Accessibility: The project selection drop down is a keyboard trap

Signed-off-by: Harish <hgovinda@redhat.com>
@harishsurf harishsurf changed the title [WIP] Bug 1874968: Pressing escape key doesn't exit the dropdown list Bug 1874968: Pressing escape key doesn't exit the dropdown list Oct 13, 2020
@openshift-ci-robot openshift-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Oct 13, 2020
this.globalKeyDown = (e) => {
if (e.key === 'Escape' && this.state.active) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fixes one problem, but the accessibility issues seem to run a little deeper. You can tab outside of the project dropdown with it still open. We should really be using a focus trap and the tab key should cycle through the items in the dropdown, with escape closing. I shouldn't be able to tab outside the dropdown to other items on the page when it's open.

cc @jessiehuff

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely agree. You should not be able to tab outside of the dropdown when it's expanded. PF's most similar comparison in terms of keyboard interaction is our Context Selector. The keyboard interaction pattern we use there is similar in that you're able to tab through the options, but when you get to the bottom, pressing tab again brings you back to the top to the search input. So, as Sam mentioned, their focus should remain in the dropdown unless they escape out/close the dropdown.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jessiehuff, in the link you shared above, using the up/down arrow keys don't seem to be traversing through the dropdown list. Only the tab key does that. Do we want to have similar behavior for this dropdown?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say that the ideal keyboard interaction would be to be able to tab to the search input and the create project button, but once focus leaves “Create Project” it should land on the options menu as a whole. Hitting the Tab key again would take the user back to the beginning of the panel, to the search input. While focus is on the options menu, the recommendation is to use arrow keys to manage focus within the menu: down/up arrow keys to traverse through the list items, right/left arrow keys to get between the item options. The reason for this is based on the WAI fundamental keyboard navigation conventions:

“A primary keyboard navigation convention common across all platforms is that the tab and shift+tab keys move focus from one UI component to another while other keys, primarily the arrow keys, move focus inside of components that include multiple focusable elements.“

The menu itself could be considered a UI component on its own and then within that UI component is when you would use the arrow keys. At least according to the WAI ideal. However, being able to tab through all items instead of using arrow keys is still accessible so what you have here with just Tab is an ok alternative. We’ve had intentions to update our context selector to follow that pattern and become more ideal as well, but given our recent commitments, it hasn’t been as high of a priority. The typeahead select is likely the most similar to the previous interaction mentioned specifically with the favoriting/bookmarking feature. For that component, you’re able to cycle through the items with the up/down arrow keys, then you press tab to switch focus into the select before you can use the up/down and right/left arrow key interaction that I’m referring to here. So it is a little bit different in how to get to the arrow key functionality, but that was necessary given the typeahead functionality of being able to select from the options as you’re typing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright. I have created this Jira to work on this. For now, this PR will be a temporary fix

Copy link
Member

@spadgett spadgett left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 3, 2020
@openshift-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: harishsurf, spadgett

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 3, 2020
@openshift-merge-robot openshift-merge-robot merged commit 3493431 into openshift:master Dec 4, 2020
@openshift-ci-robot
Copy link
Contributor

@harishsurf: All pull requests linked via external trackers have merged:

Bugzilla bug 1874968 has been moved to the MODIFIED state.

In response to this:

Bug 1874968: Pressing escape key doesn't exit the dropdown list

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@spadgett spadgett added this to the v4.7 milestone Dec 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. component/core Related to console core functionality lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants