File tree Expand file tree Collapse file tree
layouts/shared/browse-tab Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -276,7 +276,9 @@ export function useBrowseSearch(options: UseBrowseSearchOptions): BrowseSearchSt
276276 ( ) => options . projectType . value ,
277277 ( newType , oldType ) => {
278278 debug ( 'projectType changed' , { from : oldType , to : newType } )
279- currentSortType . value = { display : 'Relevance' , name : 'relevance' }
279+ effectiveCurrentSortType . value =
280+ effectiveSortTypes . value . find ( ( sortType ) => sortType . name === 'relevance' ) ??
281+ effectiveSortTypes . value [ 0 ]
280282 query . value = ''
281283 } ,
282284 )
Original file line number Diff line number Diff line change @@ -59,7 +59,6 @@ const maxResultsOptions = computed<ComboboxOption<number>[]>(() =>
5959 :model-value =" ctx.effectiveCurrentSortType.value"
6060 :options =" sortOptions"
6161 :class =" ctx.variant === 'web' ? '!w-auto flex-grow md:flex-grow-0' : 'max-w-[16rem]'"
62- placeholder =" Sort by"
6362 @update:model-value =" (val: SortType) => (ctx.effectiveCurrentSortType.value = val)"
6463 >
6564 <template #prefix >
Original file line number Diff line number Diff line change @@ -115,7 +115,7 @@ export function useSearch(
115115 { display : 'Date updated' , name : 'updated' } ,
116116 ] )
117117
118- const currentSortType : Ref < SortType > = ref ( { name : 'relevance' , display : 'Relevance' } )
118+ const currentSortType : Ref < SortType > = ref ( sortTypes [ 0 ] )
119119
120120 const route = useRoute ( )
121121 const currentPage = ref ( 1 )
You can’t perform that action at this time.
0 commit comments