From 549ac4db54a81914619c8b67d704b05fceae67aa Mon Sep 17 00:00:00 2001 From: Conrad VanLandingham Date: Tue, 9 Apr 2024 13:47:13 -0500 Subject: [PATCH] Fix linking (#213) --- packages/web-shared/components/Searchbar/Autocomplete.js | 2 +- packages/web-shared/components/Searchbar/SearchResults.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/web-shared/components/Searchbar/Autocomplete.js b/packages/web-shared/components/Searchbar/Autocomplete.js index 8b5edc1d..c0de1b99 100644 --- a/packages/web-shared/components/Searchbar/Autocomplete.js +++ b/packages/web-shared/components/Searchbar/Autocomplete.js @@ -109,7 +109,7 @@ export default function Autocomplete({ const autocomplete = useMemo(() => { return createAutocomplete({ openOnFocus: true, - plugins: [querySuggestionsPlugin, recentSearchesPlugin], + plugins: [querySuggestionsPlugin], shouldPanelOpen({ state }) { return state.query !== '' || state.collections?.length > 0; }, diff --git a/packages/web-shared/components/Searchbar/SearchResults.js b/packages/web-shared/components/Searchbar/SearchResults.js index 792517cc..f18dc241 100644 --- a/packages/web-shared/components/Searchbar/SearchResults.js +++ b/packages/web-shared/components/Searchbar/SearchResults.js @@ -230,9 +230,7 @@ const SearchResults = ({ autocompleteState, autocomplete }) => { autocompleteState.collections.map((collection, index) => { const { source, items } = collection; // Rendering of Query Suggestions - if ( - ['querySuggestionsPlugin', 'recentSearchesPlugin'].includes(collection.source.sourceId) - ) { + if (['querySuggestionsPlugin'].includes(collection.source.sourceId)) { return (
{collection.source.sourceId === 'querySuggestionsPlugin' && !inputProps.value && ( @@ -327,7 +325,7 @@ const SearchResults = ({ autocompleteState, autocomplete }) => { title={item?.title} subtitle={item?.summary} onClick={() => { - if (collection.source.sourceId === 'pages') { + if (item.source.sourceId === 'pages') { return handleStaticActionPress(item); } return handleActionPress(item);