Im having problem clearing selections in dropdown list. I sometime have to clear the selection of a dropdown since the options population changes. If a new options length is lesser than the previous one then the selection points outside the range giving error.
Simple example: (See: [https://developer.microsoft.com/en-us/fabric#Variants][1])
<Dropdown
selectedKey={ selectedItem && selectedItem.key }
onChanged={ item => this.setState({selectedItem: item}) }
options={
[
{ key: 'A', text: 'Option a' },
{ key: 'B', text: 'Option b' },
]
}
/>
The only thing I can think of is that maybe controlling selectedKey, ie setting selectedItem.key to null/undefined to clear it but Im not getting any luck with that solution..