Skip to content

Commit

Permalink
try fix search
Browse files Browse the repository at this point in the history
  • Loading branch information
dcousens committed Jun 21, 2023
1 parent 8925d38 commit ee00f7f
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions website/src/components/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,16 @@ export const Search = () => {
apiKey: '211e94c001e6b4c6744ae72fb252eaba',
indexName: 'keystonejs',
inputSelector: `#${searchId}`,
handleSelected: (input, e, suggestion) => {
e.preventDefault();
input.setVal('');
input.close();
inputRef.current.blur();
navigate(suggestion.url);
},
algoliaOptions: {
facetFilters: ['tags:v5'],
},
transformData: (results) => {
if (window.location.hostname == 'v5.keystonejs.com') return results;
return results.map((result) => {
result.url = result.url.replace('https://v5.keystonejs.com', window.location.origin);
navigate(result.url);
});
},
});
} else {
// eslint-disable-next-line no-console
Expand Down

0 comments on commit ee00f7f

Please sign in to comment.