这是indexloc提供的服务,不要输入任何密码
Skip to content

[Bug]: Listbox always autofocuses an item on mount #2056

@markjaniczak

Description

@markjaniczak

Environment

Developement/Production OS: Windows 10 19043.1110
Node version: 16.0.0
Package manager: pnpm@8.6.0
Reka UI version: 2.0.0
Vue version: 3.0.0
Nuxt version: 3.0.0
Nuxt mode: universal
Nuxt target: server
CSS framework: tailwindcss@3.3.3
Client OS: Windows 10 19043.1110
Browser: Chrome 90.0.4430.212

Link to minimal reproduction

https://reka-ui.com/docs/components/listbox#listbox

Steps to reproduce

Open the page
Check the focused element

Describe the bug

Listbox focuses the first item element on mount

Expected behavior

Listbox shouldn't automatically focus any items unless a prop like autofocus is provided. In a dropdown menu or combobox, this is typically expected. For a listbox that is permanently on the page this causes problems by moving the focus cursor to somewhere unexpected.

Context & Screenshots (if applicable)

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions