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

<Menu> doesn't close items dropdown on Escape #54

Closed
achambers opened this issue Jun 18, 2021 · 1 comment · Fixed by #58
Closed

<Menu> doesn't close items dropdown on Escape #54

achambers opened this issue Jun 18, 2021 · 1 comment · Fixed by #58
Labels
bug Something isn't working
Milestone

Comments

@achambers
Copy link
Collaborator

achambers commented Jun 18, 2021

We should make the <Menu> dropdown close when Escape is hit. I suspect it should go here.

onKeydown(event) {
switch (event.key) {
// Ref: https://www.w3.org/TR/wai-aria-practices-1.2/#keyboard-interaction-12
case 'Enter':
if (this.args.activeItem) {
this.args.activeItem.element.click();
}
this.args.closeMenu();
break;
case 'ArrowDown':
return this.args.goToNextItem();
case 'ArrowUp':
return this.args.goToPreviousItem();
}
}

@achambers achambers changed the title <Menu> doesn't close items dropdown on Escape <Menu> doesn't close items dropdown on Escape Jun 18, 2021
@achambers achambers added the bug Something isn't working label Jun 18, 2021
@alexlafroscia
Copy link
Collaborator

I'm making some other improvements to Menu right now, including implementing the item search functionality. I'll take care of this one!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants