Skip to content

Commit

Permalink
refactor(comboboxroot): length of allItems and fitlerState share watch
Browse files Browse the repository at this point in the history
  • Loading branch information
RayGuo-ergou committed Nov 22, 2024
1 parent cac99ff commit f08b732
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/core/src/Combobox/ComboboxRoot.vue
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ function filterItems() {
filterState.filtered.count = itemCount
}
watch(() => filterState.search, () => {
watch([() => filterState.search, () => allItems.value.size], () => {
filterItems()
}, { immediate: true })
Expand All @@ -181,10 +181,6 @@ watch(() => open.value, () => {
})
}, { flush: 'post' })
watch(() => allItems.value.size, (val) => {
filterItems()
})
defineExpose({
highlightedElement,
highlightItem: primitiveElement.value?.highlightItem,
Expand Down

0 comments on commit f08b732

Please sign in to comment.