We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4f96cdb commit 3513478Copy full SHA for 3513478
1 file changed
src/DocSearch.tsx
@@ -118,6 +118,9 @@ export function DocSearch({
118
openOnFocus: true,
119
initialState: {
120
query: initialQuery,
121
+ context: {
122
+ searchSuggestions: [],
123
+ },
124
},
125
navigator,
126
onStateChange({ state }) {
@@ -207,7 +210,10 @@ export function DocSearch({
207
210
208
211
// We store the `lvl0`s to display them as search suggestions
209
212
// in the “no results“ screen.
- if (state.context.searchSuggestions === undefined) {
213
+ if (
214
+ (state.context.searchSuggestions as any[]).length <
215
+ Object.keys(sources).length
216
+ ) {
217
setContext({
218
searchSuggestions: Object.keys(sources),
219
});
0 commit comments