shoelace-style/webawesome
Auf GitHub ansehenDynamically adding/removing carousel slides with the `loop` property is glitchy
Open
#2.173 geöffnet am 16. März 2026
bughelp wanted
Repository-Metriken
- Stars
- (1.104 Stars)
- PR-Merge-Metriken
- (PR-Metriken ausstehend)
Beschreibung
Describe the bug
When adding slides to a looping sl-carousel dynamically, the clone slides present challenges.
To Reproduce
Steps to reproduce the behavior:
- Go to the sl-carousel docs page
- Scroll to the add/remove example
- Modify the dom in your browser to add the loop attribute to the sl-carousel
- 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>
}
...
}