diff --git a/internal/ui/static/js/dom_helper.js b/internal/ui/static/js/dom_helper.js index fe0afcac..352d6b03 100644 --- a/internal/ui/static/js/dom_helper.js +++ b/internal/ui/static/js/dom_helper.js @@ -22,16 +22,8 @@ class DomHelper { } static getVisibleElements(selector) { - let elements = document.querySelectorAll(selector); - let result = []; - - for (let i = 0; i < elements.length; i++) { - if (this.isVisible(elements[i])) { - result.push(elements[i]); - } - } - - return result; + const elements = document.querySelectorAll(selector); + return [...elements].filter((element) => this.isVisible(element)); } static hasPassiveEventListenerOption() {