From 9f5b3f74de012daed33a50e0580a32522d57298e Mon Sep 17 00:00:00 2001 From: Scott Cazan Date: Wed, 3 Jul 2024 11:40:01 +0200 Subject: [PATCH] remove onClose from section results as well --- src/components/Search/SearchModal.tsx | 39 ++++++++----------- src/components/Search/SearchResults.tsx | 4 +- .../Search/SearchSectionResultItem.tsx | 7 +--- 3 files changed, 19 insertions(+), 31 deletions(-) diff --git a/src/components/Search/SearchModal.tsx b/src/components/Search/SearchModal.tsx index 7c8fe60e56..50f91f4caf 100644 --- a/src/components/Search/SearchModal.tsx +++ b/src/components/Search/SearchModal.tsx @@ -232,28 +232,23 @@ function SearchModalBody( {!state.ask || !withAsk ? ( - <> - { - onChangeQuery({ - ask: true, - query: state.query, - global: state.global, - }); - }} - onClose={onClose} - > - {parent && state.query ? ( - - ) : null} - - + { + onChangeQuery({ + ask: true, + query: state.query, + global: state.global, + }); + }} + > + {parent && state.query ? : null} + ) : null} {state.query && state.ask && withAsk ? ( diff --git a/src/components/Search/SearchResults.tsx b/src/components/Search/SearchResults.tsx index fbf59528f5..113a390b07 100644 --- a/src/components/Search/SearchResults.tsx +++ b/src/components/Search/SearchResults.tsx @@ -43,11 +43,10 @@ export const SearchResults = React.forwardRef(function SearchResults( parent: Site | Collection | null; withAsk: boolean; onSwitchToAsk: () => void; - onClose: (to?: string) => void; }, ref: React.Ref, ) { - const { children, query, spaceId, revisionId, parent, withAsk, onSwitchToAsk, onClose } = props; + const { children, query, spaceId, revisionId, parent, withAsk, onSwitchToAsk } = props; const language = useLanguage(); const debounceTimeout = React.useRef(null); @@ -251,7 +250,6 @@ export const SearchResults = React.forwardRef(function SearchResults( query={query} item={item} active={index === cursor} - onClick={onClose} /> ); } diff --git a/src/components/Search/SearchSectionResultItem.tsx b/src/components/Search/SearchSectionResultItem.tsx index dfc3efbe02..b620a7651f 100644 --- a/src/components/Search/SearchSectionResultItem.tsx +++ b/src/components/Search/SearchSectionResultItem.tsx @@ -11,20 +11,15 @@ export const SearchSectionResultItem = React.forwardRef(function SearchSectionRe query: string; item: ComputedSectionResult; active: boolean; - onClick: (to: string) => void; }, ref: React.Ref, ) { - const { query, item, active, onClick } = props; + const { query, item, active } = props; return ( { - event.preventDefault(); - onClick(item.href); - }} className={tcls( 'search-section-result-item', '[&:has(+:not(&))]:mb-6',