Skip to content

Conversation

@jcjp
Copy link
Contributor

@jcjp jcjp commented Sep 20, 2025

Description

closes #22060
Relates to: #21901

  • Add new props alwaysFilter defaults to false to allow the previous behavior consistent with components like VSelect and VAutocomplete
  • If set to true it will prevent to set the isPristine to false on initial load
  • Instead of passing the search immediately check isPristine and determine the value to pass

Markup:

// This example will show the previous behavior
// On menu show it should show all the items
// Pass always-filter to see it filter on load
<template>
  <v-app>
    <v-container>
      <v-combobox
        v-model="msg"
        :items="['Colorado', 'Florida', 'Georgia', 'Texas', 'Wyoming', 'California']"
      />
    </v-container>
  </v-app>
</template>

<script setup>
  import { ref } from 'vue'

  const msg = ref('Cali')
</script>

@jcjp jcjp requested a review from a team September 20, 2025 04:01
@jcjp jcjp self-assigned this Sep 20, 2025
@jcjp jcjp marked this pull request as ready for review September 20, 2025 04:12
J-Sek
J-Sek previously requested changes Sep 21, 2025
Copy link
Contributor

@J-Sek J-Sek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Menu gets unstable (opens, closes, opens, etc.) again after typing few more characters with no match.

I deliberately removed isPristine from useFilter(...) to have filterdItems predictable and depending only on the search and _searchLock (to be introduced in one of the outstanding PRs). I don't mind having it back if we can avoid regression... just feeling like we made a wrong turn at some point and state/behavior is very hard to track and impossible to keep the bugs out.

@jcjp jcjp marked this pull request as draft September 24, 2025 09:16
@jcjp jcjp force-pushed the feat/add-new-props-vcombobox-always-filter branch from 66648e1 to 69af7c3 Compare September 24, 2025 09:48
@jcjp jcjp marked this pull request as ready for review September 24, 2025 10:05
@jcjp jcjp marked this pull request as draft September 24, 2025 10:06
@jcjp jcjp dismissed J-Sek’s stale review September 24, 2025 10:22

I think this looks good, added 1 test case scenario ready for round of review thanks!

@jcjp jcjp requested a review from J-Sek September 24, 2025 10:22
@jcjp jcjp marked this pull request as ready for review September 24, 2025 10:22
J-Sek
J-Sek previously requested changes Sep 24, 2025
Copy link
Contributor

@J-Sek J-Sek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍🏼
We need an entry in new-in.json and a description for API docs that would include "matching", "suggestions" keywords and a hint about :menu-icon="false" and hide-selected for optimal UX.

@jcjp jcjp dismissed J-Sek’s stale review September 27, 2025 15:47

All done let me know if it's correct Jacek thanks!

@jcjp jcjp requested a review from J-Sek September 27, 2025 15:47
Copy link
Contributor

@J-Sek J-Sek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion it is more of a fix than a feature. We just deliver it using a separate prop to avoid unexpected behavior change in all the use cases where it is expected to act like an enhanced VAutocomplete.

@J-Sek J-Sek changed the title feat: add new props alwaysFilter to prevent automatic filter on load feat(VCombobox): always show only matching suggestions Sep 28, 2025
@J-Sek J-Sek merged commit aac10c1 into master Sep 28, 2025
18 checks passed
@J-Sek J-Sek deleted the feat/add-new-props-vcombobox-always-filter branch September 28, 2025 00:28
J-Sek pushed a commit that referenced this pull request Sep 28, 2025
@KaelWD KaelWD added this to the v3.10.x milestone Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug Report] VCombobox - only show matching suggestions

4 participants