Skip to content

[RAC] Hard to replicate all behaviors of ComboBox in "fully controlled" mode #5397

Open
@chungwu

Description

@chungwu

Provide a general summary of the feature here

In "fully-controlled" mode (described here, where I am responsible for managing the state for items, inputValue, selectedKey, it is hard to replicate the same desirable behaviors from default mode.

Specifically, I'd like to replicate this behavior:

First select some item; now the input value shows the selected item's text. Next trigger popover to open with down arrow or the trigger button. All items are shown, not just those filtered by input value. In useComboBox, it switches between showing filtered collection or all depending on how the popover was triggered. But this behavior is hard to replicate; in fully-controlled mode, I'm responsible for passing in the filtered items but there is no way for me to know whether to pass in filtered or unfiltered items, unless I try to replicate a state machine outside.

🤔 Expected Behavior?

Fully-controlled mode can achieve similar behavior from default mode

😯 Current Behavior

Some behaviors cannot be replicated easily outside

💁 Possible Solution

Allow passing in filteredItems and items separately? Or allow items be a function that takes in whether filter should happen or not?

🔦 Context

In Plasmic, we're trying to adopt React Aria Components as a suite of headless components that our users can style in a visual editor. All components operate in "controlled" mode in Plasmic.

💻 Examples

No response

🧢 Your Company/Team

Plasmic

🕷 Tracking Issue

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    • Status

      🩺 To Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions