Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,9 @@ export function useBrowseSearch(options: UseBrowseSearchOptions): BrowseSearchSt
() => options.projectType.value,
(newType, oldType) => {
debug('projectType changed', { from: oldType, to: newType })
currentSortType.value = { display: 'Relevance', name: 'relevance' }
effectiveCurrentSortType.value =
effectiveSortTypes.value.find((sortType) => sortType.name === 'relevance') ??
effectiveSortTypes.value[0]
query.value = ''
},
)
Expand Down
1 change: 0 additions & 1 deletion packages/ui/src/layouts/shared/browse-tab/layout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ const maxResultsOptions = computed<ComboboxOption<number>[]>(() =>
:model-value="ctx.effectiveCurrentSortType.value"
:options="sortOptions"
:class="ctx.variant === 'web' ? '!w-auto flex-grow md:flex-grow-0' : 'max-w-[16rem]'"
placeholder="Sort by"
@update:model-value="(val: SortType) => (ctx.effectiveCurrentSortType.value = val)"
>
<template #prefix>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/utils/search.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export function useSearch(
{ display: 'Date updated', name: 'updated' },
])

const currentSortType: Ref<SortType> = ref({ name: 'relevance', display: 'Relevance' })
const currentSortType: Ref<SortType> = ref(sortTypes[0])

const route = useRoute()
const currentPage = ref(1)
Expand Down
Loading