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

[Bug]: first item in v-for generated list of CommandItem is set to disabled and display none #868

Open
1 of 2 tasks
scottagt opened this issue Nov 5, 2024 · 1 comment
Labels
bug Something isn't working need-reproduction Issue is lacking reproduction. Will be close if not provided.

Comments

@scottagt
Copy link

scottagt commented Nov 5, 2024

Reproduction

not set

Describe the bug

I'm using Command and CommandList, CommandGroup, and CommandItem. I'm not sure I can replicate it since I do not know a way to mimic and server side call that would be accurate to how data structures are updated in my code.

We conduct a search based on the user query from the CommandInput and receive results from the server. When the results are rendered, the first result is set to disabled and the display is set to none. When the original search query is deleted from the CommandInput the first result is set to display. It seems very odd. We tried using v-model to bind to a ref with the currently selected value (whatever the first server response result is) but it doesn't have an effect.

From what I could figure from looking at ComboboxItem, there is some check being done to see if the searchFilter query is set to "" or if the current item is being returned by the filterFunction otherwise the item is set to disabled and not to display.

System Info

System:
    OS: macOS 15.1
    CPU: (16) arm64 Apple M3 Max
    Memory: 3.35 GB / 64.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - /opt/homebrew/anaconda3/envs/base/bin/node
    npm: 10.1.0 - /opt/homebrew/anaconda3/envs/base/bin/npm
  Browsers:
    Chrome: 126.0.6478.127
    Chrome Canary: 132.0.6821.0
    Safari: 18.1
  npmPackages:
    @vueuse/core: ^10.11.0 => 10.11.0 
    radix-vue: ^1.6.2 => 1.8.3 
    shadcn-vue: ^0.10.3 => 0.10.5 
    vue: ^3.4.23 => 3.4.27

Contributes

  • I am willing to submit a PR to fix this issue
  • I am willing to submit a PR with failing tests
@scottagt scottagt added the bug Something isn't working label Nov 5, 2024
@sadeghbarati sadeghbarati added the need-reproduction Issue is lacking reproduction. Will be close if not provided. label Nov 9, 2024
@sadeghbarati
Copy link
Collaborator

Hi, use nuxt.new to create a server-side playground please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working need-reproduction Issue is lacking reproduction. Will be close if not provided.
Projects
None yet
Development

No branches or pull requests

2 participants