Skip to content

ComboBox with autofocus doesn't show its dropdown auto focused with menuTrigger='focus' #5464

Open
@LFDanLu

Description

@LFDanLu

Discussed in #5462

Originally posted by austincrim November 22, 2023
I'm trying to build a CMD + K-like interface using a ComboBox inside of a Dialog. I want the ListBox options to always be visible, regardless if the Input has been typed in or manually focused (using the ComboBox menuTrigger prop).

I couldn't find a way to do this in the docs. Any recommendations?

Here's how it looks now, but I want the list of options to be visible as soon as the dialog is opened.

Stackblitz link

CleanShot.2023-11-22.at.15.14.50.mp4

As an aside, the React Spectrum support page still links to creating a new GitHub Issue, when it looks like you've switched to Discussions.

See #5462 (reply in thread) for more info. The gist is that the collection for the ComboBox is undefined/empty when the input gets autofocused since RAC collections need two renders to fully generate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    RACbugSomething isn't working

    Type

    No type

    Projects

    • Status

      🩺 To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions