mirror of
https://github.com/kamranahmedse/developer-roadmap.git
synced 2025-09-02 13:52:46 +02:00
Remove autocomplete from ai roadmap search
This commit is contained in:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user