-
Notifications
You must be signed in to change notification settings - Fork 148
Description
Which package is affected?
Headless Kit
Describe the bug
When using a Carousel component inside a Modal, the Carousel doesn't honor the initial selectedIndex or startIndex prop when the Modal opens, despite the binding being set correctly. This only occurs when the Carousel is nested inside a Modal - the binding works correctly when the Carousel is used independently outside of a modal. It is more obvious in the repro and example video. Notice how when opening the modal the carousel's index does not match the index of the signal.
nested-carousel-bug.mp4
Reproduction
https://github.com/Kesmek/nested-carousel-bug
Steps to reproduce
- Clone repro repo
- Install dependencies
bun start- Increment selected index to non-zero index
- Open modal with a nested carousel
- Carousel opens at index = 0 instead of selected index
System Info
System:
OS: Linux 6.11 Arch Linux
CPU: (16) x64 AMD Ryzen 7 7700 8-Core Processor
Memory: 16.07 GB / 30.47 GB
Container: Yes
Shell: 3.7.1 - /usr/bin/fish
Binaries:
Node: 23.1.0 - /usr/bin/node
npm: 10.9.0 - /usr/bin/npm
pnpm: 9.12.3 - /usr/bin/pnpm
bun: 1.1.34 - ~/.bun/bin/bun
npmPackages:
@builder.io/qwik: ^1.10.0 => 1.10.0
@builder.io/qwik-city: ^1.10.0 => 1.10.0
@qwik-ui/headless: ^0.6.2 => 0.6.2
typescript: 5.4.5 => 5.4.5
undici: * => 6.20.1
vite: 5.3.5 => 5.3.5Additional Information
I recognize that this might be a limitation of using modals with stateful components nested inside. If that is the case and it's written in the documentation I will close this issue. Otherwise I think it would be best to state the limitations somewhere clear in the docs.