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

Add keyboard functionality to drop-down menus #136

Open
BillyDM opened this issue Aug 10, 2024 · 2 comments
Open

Add keyboard functionality to drop-down menus #136

BillyDM opened this issue Aug 10, 2024 · 2 comments

Comments

@BillyDM
Copy link

BillyDM commented Aug 10, 2024

The DropDownMenu element should have the functionality to be navigated using the up-and-down arrow keys, selecting an option with the enter key, and hiding itself if the escape key.

@BillyDM BillyDM transferred this issue from MeadowlarkDAW/Yarrow Aug 10, 2024
@XavilPergis
Copy link

So I was giving this a try and have a few notes/questions.

  1. Should pressing down when the end of the list is selected wrap around to the beginning?
  2. Right now, selecting an element and exiting the menu will make the menu lose focus, but should this be the case? Or should it just close the menu while retaining focus so you can re-open the menu with another keystroke hypothetically?
  3. I've implemented closing the menu by releasing focus on the menu element, like clicking off with the mouse already does. Maybe as a consequence, I have to either move my mouse outside of the menu's bounds and then back in or click on the element again before I can interact with the dropdown menu. Is there a better way for me to implement this, or should this be handled elsewhere in the codebase?

@BillyDM
Copy link
Author

BillyDM commented Sep 10, 2024

  1. This could be a flag in the element handle to let the user decide what behavior they want. I would say enable wrapping by default.
  2. Yeah, I've been thinking about this, and I think I need to improve keyboard navigation functionality in Yarrow. Mouse focus and keyboard focus should probably be two separate things. I'll work on this while I'm rewriting Yarrow's API.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Ready
Development

No branches or pull requests

2 participants