Skip to content
Draft
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
10 changes: 5 additions & 5 deletions lib/MultiSelection/MultiSelection.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ const MultiSelection = ({
case useMultipleSelection.stateChangeTypes
.DropdownKeyDownBackspace:
if (backspaceDeletes) {
handleRemoval(selectedItems, changes.selectedItems, onRemove);
handleRemoval(state.selectedItems, changes.selectedItems, onRemove);
awaitingChange.current = true;
userSelection.current = changes.selectedItems;
}
Expand All @@ -210,7 +210,7 @@ const MultiSelection = ({
case useMultipleSelection.stateChangeTypes
.FunctionRemoveSelectedItem:
// this calls the onRemove handle for the variety of different ways that a selected option can be removed.
handleRemoval(selectedItems, changes.selectedItems, onRemove);
handleRemoval(state.selectedItems, changes.selectedItems, onRemove);
awaitingChange.current = true;
userSelection.current = changes.selectedItems;
return changes;
Expand Down Expand Up @@ -277,20 +277,20 @@ const MultiSelection = ({
filterText: filterValue,
inputValue: filterValue,
selectedItems,
reset
reset: state.reset
});
setFilterValue('');
return {
isOpen: false, // close the menu.
highlightedIndex, // don't move highlight cursor back to top of list on selection.
highlightedIndex: state.highlightedIndex, // don't move highlight cursor back to top of list on selection.
}
} else {
awaitingChange.current = true;
}
return {
...changes,
isOpen: true, // keep the menu open after selection.
highlightedIndex, // don't move highlight cursor back to top of list on selection.
highlightedIndex: state.highlightedIndex, // don't move highlight cursor back to top of list on selection.
}
default:
return changes
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
"classnames": "^2.2.5",
"currency-codes": "2.1.0",
"dayjs": "^1.11.10",
"downshift": "9.0.13",
"downshift": "^9.0.4",
"flexboxgrid2": "^7.2.0",
"focus-trap": "^7.5.4",
"json2csv": "^4.2.1",
Expand All @@ -123,4 +123,4 @@
"react-redux": "^8.0.5",
"react-router-dom": "^5.2.0"
}
}
}
Loading
Loading