Skip to content

Conversation

@JoosepAlviste
Copy link
Contributor

If the ComboboxInput modelValue prop was changed, then the filterState.search was not updated, so the previously filtered results were still shown in the combobox content.

With this change, we explicitly update the filterState.search whenever the modelValue is updated.

To test this, I added this snippet to the ComboboxBasic.story.vue, and added v-model="searchTerm" prop to the ComboboxInput component:

const searchTerm = ref('')
setTimeout(() => {
  searchTerm.value = 'ba'
  setTimeout(() => {
    searchTerm.value = ''
  }, 1000)
}, 2000)

and can see that the list is not filtered whenever the search term is changed:

Screen.Recording.2025-04-30.at.09.57.42.mov

However, after applying this fix, the list is filtered as expected:

Screen.Recording.2025-04-30.at.09.58.30.mov

If the `ComboboxInput` `modelValue` prop was changed, then the
`filterState.search` was not updated, so the previously filtered results
were still shown in the combobox content.

With this change, we explicitly update the `filterState.search` whenever
the `modelValue` is updated.
@pkg-pr-new
Copy link

pkg-pr-new bot commented May 5, 2025

Open in StackBlitz

npm i https://pkg.pr.new/reka-ui@1863

commit: 6ab0284

@zernonia zernonia merged commit 4b402b1 into unovue:v2 May 5, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants