From cb293fcdb3e5bac257cfea91e51f8e567e44da16 Mon Sep 17 00:00:00 2001 From: Woody Date: Fri, 24 Nov 2023 13:48:12 +0100 Subject: [PATCH] Fix filter hiding on chrome --- wled00/data/index.js | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/wled00/data/index.js b/wled00/data/index.js index a07b935bf..c08c02d11 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -2775,12 +2775,10 @@ function filterFocus(e) sCol('--sti', sti+"px"); }, 252); if (e.type === "blur") { - let t = e.relatedTarget ? e.relatedTarget : e.explicitOriginalTarget; - do { - if (t.id && (t.id === "fxFind")) { setTimeout(()=>{t.firstElementChild.focus();},150); return; } - t = t.parentElement; - } while (t.tagName !== "BODY"); - setTimeout(()=>{f.classList.add('fade');},255); // wait with hiding + setTimeout(()=>{ + if (e.target === document.activeElement) return; + f.classList.add('fade'); + },255); // wait with hiding } } @@ -2788,6 +2786,7 @@ function filterFx() { const searchIn = gId('fxFind').children[0]; searchIn.value = ''; + searchIn.focus(); clean(searchIn.nextElementSibling); const el = gId("fxlist").querySelectorAll('.lstI'); for (let i = 1; i < el.length; i++) {