feat(docsearch): introduce Selection Search
This commit is contained in:
parent
a97199a381
commit
f944f30af7
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in a new issue