Skip to content

changing the combobox with pre selected item. #2699

Answered by ghost
aratn asked this question in General
Discussion options

You must be logged in to vote

Hi @aratn. Thanks for the discussion topic here. What I'm noticing in your example snippet is that you're using a value prop to set the default and a onChange prop to manage the controlled component updates. These APIs aren't supported by Combobox within Paste. In fact, if you are using typescript in your project our published type annotations will alert you of this issue at development time prior to executing the code:

As for a solution, if you would prefer to allow the DOM to manage the updates (uncontrolled) you can provide a default with a initialSelectedItem="Adrienne Maree Brown" prop. If you would like manage the updates explicitly (controlled) you'll want to use a initialValue="A…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Components Related to the component library (core) of this system
1 participant