Skip to content

Commit

Permalink
feat(docsearch): introduce Selection Search
Browse files Browse the repository at this point in the history
  • Loading branch information
francoischalifour committed Apr 4, 2020
1 parent a97199a commit f944f30
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/DocSearch.tsx
Expand Up @@ -89,6 +89,12 @@ export function DocSearch({
autoFocus: true,
placeholder: 'Search docs...',
openOnFocus: true,
initialState: {
query:
typeof window !== 'undefined'
? window.getSelection()!.toString()
: '',
},
onStateChange({ state }) {
setState(state as any);
},
Expand Down

0 comments on commit f944f30

Please sign in to comment.