[combobox] An example for Custom value to be rendered inside Combobox
- Dominant language
- TypeScript
- Stars
- 10.9k
- Forks
- 543
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 101
Description
### Support needed
Input inside trigger example, something like React Select.
## Use Case
I want to use Combobox to build a component where consumers can render custom content as the selected value (e.g., a person's avatar with their name, product images with titles, etc.). This is similar to how React Select allows custom `SingleValue` components.
Currently, the default examples in the docs don't address this use case for single-select scenarios.
## Current Challenge
When trying to implement this pattern, I'm running into architectural issues with how to structure the trigger and input elements:
### Approach 1: Input inside Trigger (causes event conflicts)
```jsx
{/* Input clicks bubble to trigger, causing open/close flickering */}
```
### Approach 2: Multiple separate triggers (workaround)
```jsx
```
### Expected behavior:
- No selection: Show input with placeholder, clicking anywhere opens popup
- With selection: Show custom selected value, clicking anywhere opens popup and focuses input
- While typing: Hide selected value, show input for filtering
- The input does not retain the value of the selected item.
### Questions for the Team
- What's the recommended pattern for implementing custom selected value displays with React select like behavior?
Contributor guide
Assessment
This issue has not been assessed yet.