Dropdown in controlled mode (using IDropDownProps.selectedKey) mis-rendering current selection text when selecting
Bug Report
- Package version(s): (4.31.0)
- Browser and OS versions: (fill this out if relevant)
Priorities and help requested (not applicable if asking question):
Are you willing to submit a PR to fix? (No)
Requested priority: (High)
Products/sites affected: (if applicable)
Describe the issue:
When using selectedKey prop to render dropdown in the controlled patter, the dropdown current selection won't change according to user selectionActual behavior:
Selecting the second option, and then select the third(or 4th, 5th) option, the current selection text is still the second optionExpected behavior:
The current selection text should be the third(or 4th, 5th) optionIf applicable, please provide a codepen repro: https://codepen.io/yudma/pen/MvoLLM?editors=1111
FYI, using the new prop: IDropdownProps.selectedKeys will mitigate this issue.
I'm not sure whether this issue is related to issue #2422
I wasn't able to repro this bug locally.
I can repro for 4.30.0-4.32.0, if you're unable to repro feel to reach out to me (alias: chrbar)
This is creating a blocking problem within OWA Calendar. Can someone please explain to me how to use selectedKeys without having multiselect set to true. selectedKeys wont work correctly unless I set multiselect={true}.
@melvsparks I was not able to get it to work
Okay, finally figured out why the codepen example isn't working. Each time an item is selected, the selected key is set to true, and it appears that it's not being removed when other items are chosen.

Not sure why this isn't reproing locally, but at least I know where to look.
If you move the options into the component (rather than as a variable array) they work https://codepen.io/micahgodbolt/pen/gxoQgw?editors=1111
Mutability is fun, right!?!