Prevent overflow on Search page by search results

This commit is contained in:
Debanjum Singh Solanky 2024-08-03 07:07:35 +05:30
parent f3765a20b9
commit d8fe677933

View file

@ -159,13 +159,7 @@ export default function Search() {
}, [isMobileWidth]); }, [isMobileWidth]);
function search() { function search() {
if (searchResultsLoading) { if (searchResultsLoading || !searchQuery.trim()) return;
return;
}
if (!searchQuery.trim()) {
return;
}
const apiUrl = `/api/search?q=${encodeURIComponent(searchQuery)}&client=web`; const apiUrl = `/api/search?q=${encodeURIComponent(searchQuery)}&client=web`;
fetch(apiUrl, { fetch(apiUrl, {
@ -246,7 +240,7 @@ export default function Search() {
} }
{ {
!focusSearchResult && searchResults && searchResults.length > 0 && !focusSearchResult && searchResults && searchResults.length > 0 &&
<div className='mt-4'> <div className='mt-4 max-w-[92vw] break-all'>
<ScrollArea className="h-[80vh]"> <ScrollArea className="h-[80vh]">
{ {
searchResults.map((result, index) => { searchResults.map((result, index) => {