unovue / shadcn-vue

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

[Bug]: Reactivity on when using sub-property of v-model #651

Closed iplanwebsites closed 4 months ago

iplanwebsites commented 4 months ago

Reproduction

tbd

Describe the bug

Ran into a bug when using a basing feature of Input. The value displayed in input aren't consistent and will often show default. Not sure if the issue would be with Radix or the Shad wrapper.

ex: Obj = ref(null) computed() = return Obj || { placeholderProp: 123 }

<Input :value="obj.child">

Later after api call... Obj = {child: 'string inconsistently showing' , other: 123}

In my case, the Obj is a vue ref, in a parent component. Resorted to using a native HTML as I couldn't figure a quick fix.

System Info

Binaries:
    Node: 16.17.1 - ~/.nvm/versions/node/v16.17.1/bin/node
    npm: 8.15.0 - ~/.nvm/versions/node/v16.17.1/bin/npm
    pnpm: 9.3.0 - ~/Library/pnpm/pnpm
  Browsers:
    Chrome: 126.0.6478.127
  npmPackages:
    @vueuse/core: ^10.11.0 => 10.11.0
    radix-vue: ^1.8.3 => 1.8.3
    shadcn-vue: ^0.10.5 => 0.10.5
    unplugin-auto-import: ^0.17.5 => 0.17.6
    vue: ^3.4.21 => 3.4.29

Contributes

sadeghbarati commented 4 months ago

a Vue playground or reproduction would be great

sadeghbarati commented 4 months ago

Closing, for now, will reopen after reproduction