Skip to content

Commit

Permalink
add scrollability to search results in dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
ben-fornefeld committed Jan 12, 2025
1 parent edb90a9 commit 7feb06a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/web/src/components/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ function useAutocomplete({ close }: { close: () => void }) {
{
sourceId: 'documentation',
getItems() {
const results = search(query, { limit: 5 })
const results = search(query, { limit: 20 })
return results.sort((a, b) => {
if (a.badge === 'Legacy' && b.badge !== 'Legacy') return 1
if (a.badge !== 'Legacy' && b.badge === 'Legacy') return -1
Expand Down Expand Up @@ -325,7 +325,10 @@ function SearchResults({
}

return (
<ul {...autocomplete.getListProps()}>
<ul
className="max-h-[80dvh] sm:max-h-[50dvh] overflow-y-auto"
{...autocomplete.getListProps()}
>
{collection.items.map((result, resultIndex) => (
<SearchResult
key={result.url}
Expand Down

0 comments on commit 7feb06a

Please sign in to comment.