From 8a009c2b1cba6ff10e4d580424a953a28f4cccf4 Mon Sep 17 00:00:00 2001 From: Jake Low Date: Wed, 19 Feb 2025 16:56:02 -0800 Subject: [PATCH] Fix bug in autosuggest text box causing review widget to crash (#2573) --- src/components/AutosuggestTextBox/AutosuggestTextBox.jsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/AutosuggestTextBox/AutosuggestTextBox.jsx b/src/components/AutosuggestTextBox/AutosuggestTextBox.jsx index 4098f6d5b..d0960fb55 100644 --- a/src/components/AutosuggestTextBox/AutosuggestTextBox.jsx +++ b/src/components/AutosuggestTextBox/AutosuggestTextBox.jsx @@ -3,7 +3,6 @@ import Downshift from "downshift"; import _clone from "lodash/clone"; import _concat from "lodash/concat"; import _difference from "lodash/difference"; -import _filter from "lodash/filter"; import _isEmpty from "lodash/isEmpty"; import _map from "lodash/map"; import _split from "lodash/split"; @@ -207,10 +206,7 @@ export default class AutosuggestTextBox extends Component { } // Filter out any of our original preferredResults tags so they don't show in the list twice. - return _filter( - this.props.searchResults, - (t) => this.props.preferredResults.indexOf(t.name) === -1, - ); + return this.props.searchResults.filter((t) => !this.props.preferredResults?.contains(t.name)); }; render() {