fluentui icon indicating copy to clipboard operation
fluentui copied to clipboard

[Feature]: defaultSelectedKey on ComboBox

Open EmanueleUniroma2 opened this issue 2 years ago • 1 comments

Library

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

Describe the feature that you would like added

ComboBox currently only supports a defaultSelectedKey. It would be useful to have a multi-select equivalent, something like defaultSelectedKeys.

I wish to be able to set the initial selections for a multi select combo box using this attribute.

Have you discussed this feature with our team

No response

Additional context

I think this feature is just expected. Other Fluent components support it, so it's strange we don't have it on ComboBox.

Validations

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

EmanueleUniroma2 avatar Sep 06 '22 14:09 EmanueleUniroma2

I’ve added this to our backlog for review and the teams we will review the priority of the request at a later stage for future planning.

gouttierre avatar Sep 14 '22 13:09 gouttierre

defaultSelectedOptions={["Cat", "Fish"]} is already a valid prop. It should work for this use case

https://codesandbox.io/s/bold-ramanujan-5vov62?file=/example.tsx:755-795

micahgodbolt avatar Oct 26 '22 17:10 micahgodbolt

This issue has been marked as being beyond the support scope of Fluent UI's issues board. It will now be closed automatically for house-keeping purposes.

msft-fluent-ui-bot avatar Oct 27 '22 19:10 msft-fluent-ui-bot