I am trying to create a Combobox in combination with the Radix UI popover component, where I want to have a specific item/value pre-selected. I could use the value prop on the Command component but unfortunately, as soon as I open the Combobox, the value resets to the first item again.
Is there any other way to have an item pre-selected, as the expected behaviour for a Combobox component. It seems quite difficult to create a Combobox using cmdk.
For example, I am using the example from the docs. Apple is the pre-selected value but this gets reset to Orange as soon as I close and re-open the menu.
Hi there,
I am trying to create a Combobox in combination with the Radix UI popover component, where I want to have a specific item/value pre-selected. I could use the
value
prop on theCommand
component but unfortunately, as soon as I open the Combobox, the value resets to the first item again.Is there any other way to have an item pre-selected, as the expected behaviour for a Combobox component. It seems quite difficult to create a Combobox using cmdk.
For example, I am using the example from the docs. Apple is the pre-selected value but this gets reset to Orange as soon as I close and re-open the menu.