unovue / shadcn-vue

Vue port of shadcn-ui
https://www.shadcn-vue.com/
MIT License
4.89k stars 280 forks source link

[Bug]: "TeamSwitcher" freezes if you click "add" after searching #144

Closed teleskop150750 closed 11 months ago

teleskop150750 commented 12 months ago

Environment

Developement/Production OS: Windows 10 19043.1110
Node version: 16.0.0
Package manager: pnpm@8.6.0
Radix Vue version: 1.0.0
Shadcn Vue version: 1.0.0
Vue version: 3.0.0
Nuxt version: 3.0.0
Nuxt mode: universal
Nuxt target: server
CSS framework: tailwindcss@3.3.3
Client OS: Windows 10 19043.1110
Browser: Chrome 90.0.4430.212

Link to minimal reproduction

https://www.shadcn-vue.com/

Steps to reproduce

https://www.youtube.com/watch?v=JFARPdwyyTk

Describe the bug

"TeamSwitcher" freezes if you click "add" after searching

https://www.shadcn-vue.com/

Expected behavior

No response

Conext & Screenshots (if applicable)

No response

gregmsanderson commented 11 months ago

I'm also finding an issue with that component.

In my case if I visit https://www.shadcn-vue.com/ and simply click on "Alicia Koch" ... the browser freezes, just like you are seeing. The menu doesn't even open for me. No error in the console. CPU fan starts up, so it's doing something. Eventually have to close the tab.

The Combobox on https://www.radix-vue.com/ seems to work fine.

Chrome 119 on a Mac.

anonimusprogramus commented 11 months ago

Can confirm here, using Brave browser on LinuxMint.

Fixed it by changing one line in TeamSwitcher.vue

from

<CommandItem
  :value="{ label: 'Create Team' }"
  @select="() => {
    open = false
    showNewTeamDialog = true
  }"
>
  <PlusCircledIcon class="mr-2 h-5 w-5" />
  Create Team
</CommandItem>

to

<CommandItem
  value="create-team"
  @select="() => {
    open = false
    showNewTeamDialog = true
  }"
>
  <PlusCircledIcon class="mr-2 h-5 w-5" />
  Create Team
</CommandItem>
sadeghbarati commented 11 months ago

@anonimusprogramus Can you make PR for this?

anonimusprogramus commented 11 months ago

@sadeghbarati done, thanks for the opportunity

zernonia commented 11 months ago

Thanks @anonimusprogramus @sadeghbarati ! Fixed in https://github.com/radix-vue/shadcn-vue/pull/167