This repository has been archived by the owner on Mar 4, 2020. It is now read-only.
Dropdown value is [object Object] when selecting an item that is an object using DropdownItemProps #2336
Labels
vsts
Paired with ticket in vsts
Bug Report
If you provide an object for the
items
prop onDropdown
(fitting the DropdownItemProps interferace) and adefaultValue
the Dropdown seems to break and not showcontent
.Steps
Create Dropdown items that might look like this:
Here I need to create objects for these items, because I need to pass in the
active
property for some of my items.I passed in a defaultValue which is the second item in my items array. But when I do this, I get this result:
So instead I changed the Dropdown to this:
Which does give me a correct initial render:
But after selecting another item in this dropdown, I get back to a broken "[object Object]" state:
Expected Result
The expected result would be that
defaultValue
should render thecontent
on the DropdownItemProps, as well as when selecting other valuesDropdown
should render thecontent
property as well.Actual Result
The
defaultValue
renders "[object Object]" and even if you explicitly pass thecontent
prop, it breaks when selecting another value.Version
0.44.0
Testcase
https://codesandbox.io/s/fluent-ui-example-qv4e8
The text was updated successfully, but these errors were encountered: