Skip to content

fix: preserve selected filter values state with reactive Set ref #3583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 3 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
5 changes: 5 additions & 0 deletions src/components/searchbox/NodeSearchFilter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const filters = computed(() => nodeDefStore.nodeSearchService.nodeFilters)
const selectedFilter = ref<FuseFilter<ComfyNodeDefImpl, string>>()
const filterValues = computed(() => selectedFilter.value?.fuseSearch.data ?? [])
const selectedFilterValue = ref<string>('')
const existingFilters = ref(new Set<string>())

const nodeDefStore = useNodeDefStore()

Expand All @@ -60,6 +61,10 @@ const submit = () => {
if (!selectedFilter.value) {
return
}
if (existingFilters.value.has(selectedFilterValue.value)) {
return
}
existingFilters.value.add(selectedFilterValue.value)
emit('addFilter', {
filterDef: selectedFilter.value,
value: selectedFilterValue.value
Expand Down