File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ const showSearchBar = computed(() => {
1616 return route .name !== ' index'
1717})
1818
19- const { model : searchQuery, flushUpdateUrlQuery } = useGlobalSearch ()
19+ const { model : searchQuery, flushUpdateUrlQuery } = useGlobalSearch (' header ' )
2020
2121function handleSubmit() {
2222 flushUpdateUrlQuery ()
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { debounce } from 'perfect-debounce'
44// Pages that have their own local filter using ?q
55const pagesWithLocalFilter = new Set ( [ '~username' , 'org' ] )
66
7- export function useGlobalSearch ( ) {
7+ export function useGlobalSearch ( place : 'header' | 'content' = 'content' ) {
88 const { searchProvider } = useSearchProvider ( )
99 const searchProviderValue = computed ( ( ) => {
1010 const p = normalizeSearchParam ( route . query . p )
@@ -32,7 +32,7 @@ export function useGlobalSearch() {
3232 const updateUrlQueryImpl = ( value : string , provider : 'npm' | 'algolia' ) => {
3333 const isSameQuery = route . query . q === value && route . query . p === provider
3434 // Don't navigate away from pages that use ?q for local filtering
35- if ( pagesWithLocalFilter . has ( route . name as string ) || isSameQuery ) {
35+ if ( ( pagesWithLocalFilter . has ( route . name as string ) && place === 'content' ) || isSameQuery ) {
3636 return
3737 }
3838
You can’t perform that action at this time.
0 commit comments