From 8878d04f986c08d1f65740f60632b71d648a4e7b Mon Sep 17 00:00:00 2001 From: Kamran Ahmed Date: Sat, 15 Mar 2025 04:28:44 +0000 Subject: [PATCH] Remove autocomplete from ai roadmap search --- .../GenerateRoadmap/AITermSuggestionInput.tsx | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/src/components/GenerateRoadmap/AITermSuggestionInput.tsx b/src/components/GenerateRoadmap/AITermSuggestionInput.tsx index 1d183534a..bb388f05f 100644 --- a/src/components/GenerateRoadmap/AITermSuggestionInput.tsx +++ b/src/components/GenerateRoadmap/AITermSuggestionInput.tsx @@ -128,32 +128,32 @@ export function AITermSuggestionInput(props: AITermSuggestionInputProps) { return allRoadmaps; }; - useEffect(() => { - if (debouncedSearchValue.length === 0 || isFirstRender.current) { - setSearchResults([]); - return; - } + // useEffect(() => { + // if (debouncedSearchValue.length === 0 || isFirstRender.current) { + // setSearchResults([]); + // return; + // } - setIsActive(true); - setIsLoading(true); - loadTopAIRoadmapTerm() - .then((results) => { - const normalizedSearchText = debouncedSearchValue.trim().toLowerCase(); - const matchingOfficialRoadmaps = officialRoadmaps.filter((roadmap) => { - return ( - roadmap.title.toLowerCase().indexOf(normalizedSearchText) !== -1 - ); - }); + // setIsActive(true); + // setIsLoading(true); + // loadTopAIRoadmapTerm() + // .then((results) => { + // const normalizedSearchText = debouncedSearchValue.trim().toLowerCase(); + // const matchingOfficialRoadmaps = officialRoadmaps.filter((roadmap) => { + // return ( + // roadmap.title.toLowerCase().indexOf(normalizedSearchText) !== -1 + // ); + // }); - setSearchResults( - [...matchingOfficialRoadmaps, ...results]?.slice(0, 5) || [], - ); - setActiveCounter(0); - }) - .finally(() => { - setIsLoading(false); - }); - }, [debouncedSearchValue]); + // setSearchResults( + // [...matchingOfficialRoadmaps, ...results]?.slice(0, 5) || [], + // ); + // setActiveCounter(0); + // }) + // .finally(() => { + // setIsLoading(false); + // }); + // }, [debouncedSearchValue]); useEffect(() => { if (isFirstRender.current) {