From ceb330e3e45ec7309d31218e60f0f9395ca54517 Mon Sep 17 00:00:00 2001 From: Woody Date: Sun, 26 Nov 2023 18:15:00 +0100 Subject: [PATCH] Do not hide filter menu if filter is active --- wled00/data/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/wled00/data/index.js b/wled00/data/index.js index 5a6b1f966..10ebfaa41 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -232,6 +232,7 @@ function onLoad() tooltip(); resetPUtil(); + initFilters(); if (localStorage.getItem('pcm') == "true" || (!/Mobi/.test(navigator.userAgent) && localStorage.getItem('pcm') == null)) togglePcMode(true); applyCfg(); @@ -2764,6 +2765,10 @@ function clean(clearButton) { search(inputField, clearButton.parentElement.nextElementSibling.id); } +function initFilters() { + gId("filters").querySelectorAll("input[type=checkbox]").forEach((e) => { e.checked = false; }); +} + function filterFocus(e) { const f = gId("filters"); if (e.type === "focus") f.classList.remove('fade'); // immediately show (still has transition) @@ -2775,6 +2780,8 @@ function filterFocus(e) { if (e.type === "blur") { setTimeout(() => { if (e.target === document.activeElement && document.hasFocus()) return; + // do not hide if filter is active + if (gId("filters").querySelectorAll("input[type=checkbox]:checked").length) return; f.classList.add('fade'); }, 255); // wait with hiding }