Skip to content
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

How do I use an empty string with a USelect value? #3647

Closed
jwoertink opened this issue Mar 21, 2025 · 1 comment
Closed

How do I use an empty string with a USelect value? #3647

jwoertink opened this issue Mar 21, 2025 · 1 comment
Labels
question Further information is requested v3 #1289

Comments

@jwoertink
Copy link
Contributor

Description

My app uses a LOT of filters, and with UI v2, I had these:

<USelect :items="items" placeholder="Filter by tags" v-model="tagFilter" />

// filter by tags
const items = [
  {
    label: "Show all tags",
    value: ""
   },
   {
     label: "Only Red Tags",
      value: "red"
   },
   {
     label: "Only Green Tags",
     value: "green"
  }
]

const tagFilter = ref(null)

but in v3 I now get this error:

Error: A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.

How would I add this option in?

@jwoertink jwoertink added question Further information is requested v3 #1289 labels Mar 21, 2025
@jwoertink
Copy link
Contributor Author

Ok, just realized I can use value: null and this works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested v3 #1289
Projects
None yet
Development

No branches or pull requests

1 participant