Skip to content
This repository was archived by the owner on Mar 13, 2018. It is now read-only.

Commit fd9b3ee

Browse files
committed
use .items instead of .children.
Prevents gotchas when using `<template repeat>` inside of <core-pages>. Template will be counted as a child.
1 parent 55e8a4c commit fd9b3ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

demo.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,15 +111,15 @@
111111

112112
<script>
113113
document.querySelector('#first').onclick = function(e) {
114-
this.selected = (this.selected + 1) % this.children.length;
114+
this.selected = (this.selected + 1) % this.items.length;
115115
};
116116

117117
document.querySelector('core-pages.fancy').onclick = function(e) {
118-
this.selected = (this.selected + 1) % this.children.length;
118+
this.selected = (this.selected + 1) % this.items.length;
119119
this.async(function() {
120120
if (this.selectedIndex == 0) {
121121
this.selectedItem.classList.remove('begin');
122-
} else if (this.selectedIndex == this.children.length - 1) {
122+
} else if (this.selectedIndex == this.items.length - 1) {
123123
this.items[0].classList.add('begin');
124124
}
125125
});

0 commit comments

Comments
 (0)