shoelace-style/webawesome

Dynamically adding/removing carousel slides with the `loop` property is glitchy

Open

#2.173 aberto em 16 de mar. de 2026

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)TypeScript (157 forks)github user discovery
bughelp wanted

Métricas do repositório

Stars
 (1.104 stars)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

Describe the bug

When adding slides to a looping sl-carousel dynamically, the clone slides present challenges.

To Reproduce

Steps to reproduce the behavior:

  1. Go to the sl-carousel docs page
  2. Scroll to the add/remove example
  3. Modify the dom in your browser to add the loop attribute to the sl-carousel
  4. Try to use the example to add/remove slides.

Additional information

This could probably be solved by having the clone slides live outside the slot.

Pseudocode alert!

render() {
...
  if (loop) {
    <sl-carousel-clone></sl-carousel-clone>
  }
  <slot></slot>
  if (loop) {
    <sl-carousel-clone></sl-carousel-clone>
  }
...
}

Guia do colaborador