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": "Picker: The shift key is now required (in addition to the del key) in order to delete a suggestion.",
"type": "patch"
}
],
"packageName": "office-ui-fabric-react",
"email": "[email protected]"
}
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,15 @@ export class BaseFloatingPicker<T, P extends IBaseFloatingPickerProps<T>> extend
this.props.onRemoveSuggestion &&
this.suggestionsControl &&
this.suggestionsControl.hasSuggestionSelected &&
this.suggestionsControl.currentSuggestion
this.suggestionsControl.currentSuggestion &&
ev.shiftKey
) {
(this.props.onRemoveSuggestion as ((item: T) => void))(this.suggestionsControl.currentSuggestion!.item);

this.suggestionsControl.removeSuggestion();
this.forceUpdate();
ev.stopPropagation();
}
ev.stopPropagation();
break;

case KeyCodes.up:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ export class SuggestionsCore<T> extends BaseComponent<ISuggestionsCoreProps<T>,
this.currentSuggestion = suggestions[0];
this.currentSuggestion.selected = true;
} else {
if (this.currentIndex > -1) {
if (this.currentIndex > -1 && suggestions[this.currentIndex]) {
suggestions[this.currentIndex].selected = false;
}
suggestions[index].selected = true;
Expand Down