Closed MarkusKramer closed 9 years ago
Hi @MarkusKramer, thanks for this bug report.
The code in basic-page-dots does look wrong, and I want to fix it. (In general, the topic of removing this component or its children from the DOM could stand more exploration.) But before I just blindly incorporate a fix, I would first like to reproduce the bug you're seeing. I can't see this myself in Chrome under Shady DOM or Shadow DOM.
What I'm trying:
While I get some incorrect behavior, I'm not seeing the specific bug you're hitting. Can you provide more detail about the environment you're using, or the specific repro steps? I want to make sure I'm actually fixing your bug, not just covering it up.
Thanks for the quick response. I've created this jsfiddle that reproduces the problem. http://jsfiddle.net/ktbvev4a/1/
It appears the problem only exists if you're using a dom-repeat within the carousel. Hope that helps.
@MarkusKramer Just wanted to let you know that I've fixed an additional bug that was preventing your jsFiddle from working as expected.
While fixing the particular bug related to carousel removal, I noticed a separate, rendering issue: the carousel looked as if it were were trying to show one more item that actually existed. Among other things, there were 3 dots, but only 2 images. I traced this to your use of the <template is="dom-repeat">
. The carousel was incorrectly interpreting the <template>
itself as an element, hence the additional dot.
Your use of <template is="dom-repeat">
inside a list-like component seems like a really useful web component idiom, so I wanted to fix the underlying problem. This is, in fact, a criteria on the evolving Gold Standard checklist for web components: a component should cope with Auxiliary Content like link
, script
, style
, and template
.
I've just checked in a fix for this such that all list-like components (including basic-carousel and basic-list-box) now ignore auxiliary content nodes. So you should be able to use a template
inside a carousel, and the carousel should reflect the correct number of visible child elements.
This fix will go out in the 0.6.3 release in the next couple of weeks.
Awesome. I actually noticed that last blank page but never really bothered about it ;-) I m looking forward to the 0.6.3 release. Thanks for the great work on basic-carousel !!
Thanks!
Version 0.6.3 has now been released.
When the carousel component is removed from the DOM I get:
The reason seems to be this section in basic-page-dots.html
When removing it's children the list existingDots is getting shorter and shorter. Using
solves this issue.
Using basic-web-components/basic-carousel#0.6.2