Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"changes": [
{
"packageName": "office-ui-fabric-react",
"comment": "Revisited the Multi-select Combo box initial state selection fix",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "asish2k14@outlook.com"
}
Original file line number Diff line number Diff line change
Expand Up @@ -804,7 +804,8 @@ export class ComboBox extends BaseComponent<IComboBoxProps, IComboBoxState> {
return;
}
if (this.props.multiSelect) {
option.selected = !option.selected;
// Setting the initial state of option.selected in Multi-select combobox by checking the selectedIndices array and overriding the undefined issue
option.selected = option.selected !== undefined ? !option.selected : (selectedIndices.indexOf(index) < 0);
if (option.selected && selectedIndices.indexOf(index) < 0) {
selectedIndices.push(index);
} else if (!option.selected && selectedIndices.indexOf(index) >= 0) {
Expand Down