radix-vue / shadcn-vue

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

[Bug]: Carousel - Cannot read properties of undefined (reading 'canScrollNext') #611

Closed Artemiy111 closed 2 weeks ago

Artemiy111 commented 2 weeks ago

Reproduction

Write <Carousel :opts="{ active: false }"></Carousel>

Describe the bug

api is undefined if active is set to false

Also may be empla-carousel-vue type definition issue, because it not specifies that CarouselApi can be undefined

System Info

System:
    OS: Windows 11 10.0.22631
    CPU: (16) x64 AMD Ryzen 9 5900HS with Radeon Graphics
    Memory: 2.88 GB / 15.41 GB
  Binaries:
    Node: 21.5.0 - C:\Program Files\nodejs\node.EXE
    npm: 10.8.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 9.2.0 - C:\Program Files\nodejs\pnpm.CMD
    bun: 1.1.3 - ~\.bun\bin\bun.EXE
  Browsers:
    Edge: Chromium (125.0.2535.92)
    Internet Explorer: 11.0.22621.3527

Contributes