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

[🐞] (Headless) Carousel inside Modal doesn't honor initial startIndex or selectedIndex binding #1006

Open
Kesmek opened this issue Nov 12, 2024 · 0 comments
Labels
STATUS-1: needs triage This doesn't seem right TYPE: bug Something isn't working

Comments

@Kesmek
Copy link

Kesmek commented Nov 12, 2024

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

  1. Clone repro repo
  2. Install dependencies
  3. bun start
  4. Increment selected index to non-zero index
  5. Open modal with a nested carousel
  6. 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.5

Additional 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.

@Kesmek Kesmek added STATUS-1: needs triage This doesn't seem right TYPE: bug Something isn't working labels Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
STATUS-1: needs triage This doesn't seem right TYPE: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant