diff --git a/src/DocSearch.tsx b/src/DocSearch.tsx index 56e1cbbb..83d5baad 100644 --- a/src/DocSearch.tsx +++ b/src/DocSearch.tsx @@ -57,7 +57,9 @@ export function DocSearch({ const recentSearches = React.useRef( createStoredSearches({ key: '__DOCSEARCH_RECENT_SEARCHES__', - limit: 5, + // We display 7 recent searches and there's no favorites, but only + // 4 when there are favorites. + limit: favoriteSearches.getAll().length === 0 ? 7 : 4, }) ).current;