Skip to content

fix(ui-grid-column-menu.js): Added keyboard navigation to column menu #6629

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

Merged
merged 3 commits into from
Mar 23, 2018

Conversation

DanielDiTommaso
Copy link
Contributor

@DanielDiTommaso DanielDiTommaso commented Mar 22, 2018

Provided keydown handlers for uiGridColumnMenu so you can tab-cycle through the menu items
correctly. Escape also now closes an open menu.

fix #5075

}
}, visibleMenuItems);

if (visibleMenuItems.length) {
Copy link
Member

Choose a reason for hiding this comment

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

What happens if there is only a single column header menu item? For example the company column of the first grid in the plunker bellow:
http://plnkr.co/edit/?p=preview

It can be seen in the 102 Sorting tutorial.

Copy link
Member

@mportuga mportuga left a comment

Choose a reason for hiding this comment

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

Please ensure that your logic can handle a menu with a single visible menu item.

Provided keydown handlers for uiGridColumnMenu so you can tab-cycle through the menu items
correctly. Escape also now closes an open menu.

fix angular-ui#5075
if (visibleMenuItems.length) {
if (visibleMenuItems.length === 1) {
visibleMenuItems[0].onkeydown = function singleItemHandler(event) {
circularFocusHandler(event, true);
Copy link
Member

Choose a reason for hiding this comment

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

Can't you just call event.preventDefault directly here?

Copy link
Member

Choose a reason for hiding this comment

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

Never mind, I talked to you in person and see the if statement.

@mportuga mportuga merged commit df42920 into angular-ui:master Mar 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Column Menu does not retain focus when tabbing through menu options - Accessibility buug
2 participants