From 7e9a8cc6b62a47dfd920ea33ace04c009061b301 Mon Sep 17 00:00:00 2001 From: Nils Bergmann Date: Mon, 24 Jun 2019 16:10:25 +0200 Subject: [PATCH] getScrollParent window If you use the infinity wrapper inside of a webcomponent and you want to target the window, you need to skip the querySelector. The vue element can not query things outside of the webcomponent. This is a very specific check. However, it also doesn't break anything. --- src/components/InfiniteLoading.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/InfiniteLoading.vue b/src/components/InfiniteLoading.vue index 8305469..5cfab06 100644 --- a/src/components/InfiniteLoading.vue +++ b/src/components/InfiniteLoading.vue @@ -316,7 +316,11 @@ export default { let result; if (typeof this.forceUseInfiniteWrapper === 'string') { - result = elm.querySelector(this.forceUseInfiniteWrapper); + if (this.forceUseInfiniteWrapper === 'window') { + result = window; + } else { + result = elm.querySelector(this.forceUseInfiniteWrapper); + } } if (!result) {