[select] Specifying direction for arrow key navigation
Nobody has claimed this yet.
- Dominant language
- MDX
- Stars
- 4.5k
- Forks
- 226
- Avg merge
- 2d 22h
- Merged PRs (30d)
- 4
Description
Proposal
the ability to set directionality for the arrow key/tab navigation of select options:
Syntax is very strawman, but I wold like the ability to decide if the direction should be block, inline, or both.
::picker(select) {
tab-direction: block || inline || block inline || both; /* alternatively both = block inline */
tab-start: start || end;
}
"tab-direction"
tab-direction: block= also the default (current behavior), arrow keys up and down move through options in one directiontab-direction: inline= arrow keys left and right move through options in one directiontab-direction: block inline= left arrow behavior, and bottom arrow = right arrow behavior move through options in one directiontab-direction: both= arrow keys up/left/down/right move in multiple directions (I'm not sure how this would be implemented to be honest, but it would be neat!)
** horizontal and vertical may be better than inline and block*
"tab-start"
tab-start: start= navigation starts at first item (current default)tab-start: end= navigation starts at last item, and moves to first
Examples
Demo 1: AirBnb select demo
This one would benefit from tab-direction: both
Demo 2: Rotated cards (Canary only, uses size attribute, will probably break)
Here is a select with options that are accessed via scroller. The intersection of select (arrow keys up and down) and horizontal scroll (arrow keys left and right) don't play well together.
In this example, I can visually move through the list, snapping the items into place using the left and right arrow keys. I can tab through the items using the up and down arrows, but visually the items don't snap into place.
Demo 3: Radial menu
This menu should go right to left horizontally:
tab-direction: inline;
tab-start: end;
Prior art
I hoped reading-flow() would help here but it doesn't seem to.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the proposed tab-direction and tab-start behaviors, then review the three demos and the reading-flow() prior art cited in the issue. Clarify the navigation model, syntax, and expected behavior for each direction before documenting an agreed specification; this issue does not identify implementation files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css
- Domain
- frontend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100