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.
Should pressing down when the end of the list is selected wrap around to the beginning?
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?
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?
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.
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.
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.