Skip to content

Commit 226f8cf

Browse files
committed
Fix to properly add the tracked elements
This is a fix to properly add the tracked elements to the elements array. Previously, this.withTracking would end up referencing window instead of the ElementQueries instance. The elements.indexOf(element) is to prevent adding duplicate elements. Fixes marcj#61
1 parent 6fbaa67 commit 226f8cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ElementQueries.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@
148148
}
149149
element.elementQueriesSetupInformation.call();
150150

151-
if (this.withTracking) {
151+
if (ElementQueries.instance.withTracking && elements.indexOf(element) < 0) {
152152
elements.push(element);
153153
}
154154
}

0 commit comments

Comments
 (0)