Skip to content

Pressing "down" key does not select / navigate packages #1078

Closed

Description

@martinszeltins

I typed the package into the search box, I wanted to navigate the search results using the "down" key, but instead of navigating / selecting packages, it seems to be selecting all focusable elements. I would expect the "Tab" key to do that not "down" key. The "down" key should select and navigate actual packages.

For example here I would expect this:

  1. Type "tooltip" into search
  2. Press "down" key -> select first package "tooltip"
  3. Press "down" again -> select next package "rc-tooltip"
  4. Press "down" again -> select next one "react-tooltip"

Screencast:

Screencast.From.2026-02-06.09-40-35.mp4

Activity

  1. added
    frontFrontend, Design
    a11yRelated to accessibility and inclusion
    on Feb 6, 2026
  2. Codefoxdev commented on Feb 6, 2026

    @Codefoxdev
    Contributor

    I just noticed something similar on the compare page, even though the search box displays a list with options below it, there is no way to use the arrow keys to select one of the options.
    Or should this be a separate issue, since the components are not related to each other?

  3. knowler commented on Feb 7, 2026

    @knowler
    Member

    Seems like this is a little greedy?

    /**
    * Get all focusable result elements in DOM order (suggestions first, then packages)
    */
    function getFocusableElements(): HTMLElement[] {
    const suggestions = Array.from(
    document.querySelectorAll<HTMLElement>('[data-suggestion-index]'),
    ).sort((a, b) => {
    const aIdx = Number.parseInt(a.dataset.suggestionIndex ?? '0', 10)
    const bIdx = Number.parseInt(b.dataset.suggestionIndex ?? '0', 10)
    return aIdx - bIdx
    })
    const packages = Array.from(document.querySelectorAll<HTMLElement>('[data-result-index]')).sort(
    (a, b) => {
    const aIdx = Number.parseInt(a.dataset.resultIndex ?? '0', 10)
    const bIdx = Number.parseInt(b.dataset.resultIndex ?? '0', 10)
    return aIdx - bIdx
    },
    )
    return [...suggestions, ...packages]
    }

    I also wonder if this shortcut shouldn’t become active until the user presses Enter which unfocuses the search field. That’s how it works in search engines. I also might be saying this selfishly because, as a (n)vim user, I also want j and k to go through the results (and that wouldn’t make sense unless you unfocused the search field).

  4. added theissue type on Feb 7, 2026
  5. added this to the Alpha announcement milestone on Feb 27, 2026
  6. added a commit that references this issue on Feb 27, 2026
    4081cc9
  7. moved this from Backlog to Released in Releaseson Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    a11yRelated to accessibility and inclusionfrontFrontend, Designp2Priority 2 bug (medium)

    Type

    Projects

    • Status
      Released

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions