Skip to content

Commit

Permalink
Merge branch '167-tunocent-small-software-fixes-and-additions' into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
Mau Zsofia Abraham committed Oct 2, 2024
2 parents bc08530 + 6717a8b commit 9591a06
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
1 change: 1 addition & 0 deletions components/explore-samples-form-window-content.vue
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ const openSearchResultsWindow = function () {
<TagsSelect
v-if="featureLabelsQuery.data"
v-model="features"
:filter-function="(i) => i"
:options="featureLabelsQuery.data as unknown as Array<Tag>"
:placeholder="`Search for features...`"
/>
Expand Down
12 changes: 2 additions & 10 deletions components/ui/tags-select.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,14 @@ interface Tag {
interface Props {
options: Array<Tag>;
placeholder: string;
filterFunction?: (list: Array<string>, searchTerm: string) => Array<string>;
filterFunction: (list: Array<string>, searchTerm: string) => Array<string>;
}
const props = defineProps<Props>();
const { options, placeholder, filterFunction } = toRefs(props);
const searchTerm = ref("");
const model = defineModel<Array<string>>();
const open = ref(false);
const filter = computed(() => {
return (
filterFunction.value ??
function (list: Array<string>, searchTerm: string) {
return list.filter((value) => value === searchTerm);
}
);
});
watch(
model,
() => {
Expand All @@ -58,7 +50,7 @@ watch(
v-model:open="open"
v-model:search-term="searchTerm"
class="mx-auto w-full"
:filter-function="filter"
:filter-function="filterFunction"
multiple
>
<ComboboxAnchor class="w-full">
Expand Down

0 comments on commit 9591a06

Please sign in to comment.