fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

[Feature]: add support for `contentBefore` to Dropdown/Combobox

Open stefan-schweiger opened this issue 2 years ago • 10 comments

Library

React Components / v9 (@fluentui/react-components)

Describe the feature that you would like added

The Input component currently supports adding additional elements with the contentBefore/contentAfter properties. In Dropdown/Combobox there is a property called expandIcon which does more or less the same thing as contentAfter but there is no way of adding additional content before.

image image

For example this would be useful to add a "magnifying glass" icon to a Combobox with autocomplete to indicate that it's a searchbox.

MS Teams (which kind of works like a ComboBox but has no expandIcon): image

Google: image

Have you discussed this feature with our team

No response

Additional context

No response

Validations

  • [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.

stefan-schweiger avatar May 10 '23 09:05 stefan-schweiger

I had the wrong version selected when creating this. I've changed it in the issue but it would be great if someone could update the label.

stefan-schweiger avatar May 10 '23 09:05 stefan-schweiger

@stefan-schweiger updated 👍

layershifter avatar May 24 '23 08:05 layershifter

And also contentAfter ?

kevinfairclough avatar Sep 05 '23 15:09 kevinfairclough

For workaround, maybe you can use render function in input prop of Combobox to render Input component with contentBefore and contentAfter, and set expandIcon to null. In Dropdown you can use button prop to render Button component, or your custom component with Button component prop. But I don't know whether it's a right thing to do or not.

For Combobox:

input={{
children: (_,inputProps)=> <Input {...inputProps} contentBefore={...}/>
}}

darmageddon avatar Dec 16 '23 01:12 darmageddon

+1 on adding these properties to combobox/dropdown. I've tried using a render callback but it is not immediately easy - too clunky to simply add an extra icon in the output.

fpintos avatar Jan 29 '24 21:01 fpintos

keep open

stefan-schweiger avatar Jul 28 '24 12:07 stefan-schweiger

keep open

stefan-schweiger avatar Jan 25 '25 17:01 stefan-schweiger

+1!

Microsoft Clipchamp has a dropdown like this. It would be nice to have something similarly easy to use.

Image

lriki avatar May 13 '25 08:05 lriki

This issue has not had activity for over 180 days! We're adding Soft close label and will close it soon for house-keeping purposes. Still require assistance? Please add comment - "keep open".

keep open

yhaskell avatar Dec 01 '25 11:12 yhaskell