Skip to content

Combobox with displayValue and placeholder #1533

Answered by thraizz
thraizz asked this question in Help
Discussion options

You must be logged in to vote

Nevermind, I solved this myself: You can just return an empty string in the displayValue function, the Combobox.Input will then show the placeholder instead.
So something like:

<Combobox.Input
    displayValue={(myObject) =>
      myObject ? myObject.name : ""
    }
    placeholder="My placeholder"
    // [...}
/>

should work.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@toniopelo
Comment options

Answer selected by thraizz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants