From c92c4007af384d370e0045946e9a0d2ea1a41320 Mon Sep 17 00:00:00 2001 From: Sj-Si Date: Fri, 3 May 2024 13:21:56 -0400 Subject: [PATCH] fix bug caused by resize on selecting other page tabs. --- javascript/clusterize.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/javascript/clusterize.js b/javascript/clusterize.js index 4fe4af4d5..b7f8d7d14 100644 --- a/javascript/clusterize.js +++ b/javascript/clusterize.js @@ -144,12 +144,11 @@ class Clusterize { } async refresh(force) { - // Refresh can be a longer operation so we want to debounce it to - // avoid refreshing too often. - if (!this.setup_has_run || !this.enabled) { + if (!this.setup_has_run || !this.enabled || isNullOrUndefined(this.content_elem.offsetParent)) { return; } - + // Refresh can be a longer operation so we want to debounce it to + // avoid refreshing too often. clearTimeout(this.#refresh_debounce_timer); this.#refresh_debounce_timer = setTimeout( async () => {