1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-09-03 06:12:53 +02:00

Remove autocomplete from ai roadmap search

This commit is contained in:
Kamran Ahmed
2025-03-15 04:28:44 +00:00
parent 1085c33dc4
commit 8878d04f98

View File

@@ -128,32 +128,32 @@ export function AITermSuggestionInput(props: AITermSuggestionInputProps) {
return allRoadmaps; return allRoadmaps;
}; };
useEffect(() => { // useEffect(() => {
if (debouncedSearchValue.length === 0 || isFirstRender.current) { // if (debouncedSearchValue.length === 0 || isFirstRender.current) {
setSearchResults([]); // setSearchResults([]);
return; // return;
} // }
setIsActive(true); // setIsActive(true);
setIsLoading(true); // setIsLoading(true);
loadTopAIRoadmapTerm() // loadTopAIRoadmapTerm()
.then((results) => { // .then((results) => {
const normalizedSearchText = debouncedSearchValue.trim().toLowerCase(); // const normalizedSearchText = debouncedSearchValue.trim().toLowerCase();
const matchingOfficialRoadmaps = officialRoadmaps.filter((roadmap) => { // const matchingOfficialRoadmaps = officialRoadmaps.filter((roadmap) => {
return ( // return (
roadmap.title.toLowerCase().indexOf(normalizedSearchText) !== -1 // roadmap.title.toLowerCase().indexOf(normalizedSearchText) !== -1
); // );
}); // });
setSearchResults( // setSearchResults(
[...matchingOfficialRoadmaps, ...results]?.slice(0, 5) || [], // [...matchingOfficialRoadmaps, ...results]?.slice(0, 5) || [],
); // );
setActiveCounter(0); // setActiveCounter(0);
}) // })
.finally(() => { // .finally(() => {
setIsLoading(false); // setIsLoading(false);
}); // });
}, [debouncedSearchValue]); // }, [debouncedSearchValue]);
useEffect(() => { useEffect(() => {
if (isFirstRender.current) { if (isFirstRender.current) {