Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in autosuggest text box causing review widget to crash #2573

Merged
merged 1 commit into from
Feb 20, 2025

Conversation

jake-low
Copy link
Contributor

Introduced accidentally by me in #2517. Lodash's _indexOf(arr, elem) returns -1 if arr is undefined, and the AutosuggestTextBox component depended on this behavior. This PR changes the logic to use optional chaining (to guard against preferredResults being undefined) and Array.contains() (to remove the double negative and make intent clearer).

@jake-low jake-low merged commit 8a009c2 into main Feb 20, 2025
4 checks passed
@jake-low jake-low deleted the jlow/fix-review-widget branch February 20, 2025 00:56
@CollinBeczak CollinBeczak mentioned this pull request Feb 23, 2025
@jake-low jake-low mentioned this pull request Mar 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants