-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Conversation
4f07b15
to
752bf6e
Compare
} | ||
}, visibleMenuItems); | ||
|
||
if (visibleMenuItems.length) { |
There was a problem hiding this comment.
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.
There was a problem hiding this 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
752bf6e
to
a0a0392
Compare
if (visibleMenuItems.length) { | ||
if (visibleMenuItems.length === 1) { | ||
visibleMenuItems[0].onkeydown = function singleItemHandler(event) { | ||
circularFocusHandler(event, true); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
Provided keydown handlers for uiGridColumnMenu so you can tab-cycle through the menu items
correctly. Escape also now closes an open menu.
fix #5075