From e641fcfadacf489e9becbd7774d4bc593801f548 Mon Sep 17 00:00:00 2001 From: Damian Schneider Date: Fri, 17 Apr 2026 10:19:46 +0200 Subject: [PATCH 1/2] fix blending style options list filter for iOS --- wled00/data/index.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/wled00/data/index.js b/wled00/data/index.js index 58b21c32ed..a5f5e87bd9 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -25,6 +25,7 @@ var pN = "", pI = 0, pNum = 0; var pmt = 1, pmtLS = 0; var lastinfo = {}; var isM = false, mw = 0, mh=0; +var bsOpts = null; // blending style options snapshot, used for dynamic filtering based on matrix mode (iOS compatibility) var ws, wsRpt=0; var cfg = { theme:{base:"dark", bg:{url:"", rnd: false, rndGrayscale: false, rndBlur: false}, alpha:{bg:0.6,tab:0.8}, color:{bg:""}}, @@ -660,12 +661,15 @@ function parseInfo(i) { mw = i.leds.matrix ? i.leds.matrix.w : 0; mh = i.leds.matrix ? i.leds.matrix.h : 0; isM = mw>0 && mh>0; + if (!bsOpts) bsOpts = Array.from(gId('bs').options).map(o => o.cloneNode(true)); // snapshot all options on first call + const bsSel = gId('bs'), bsCur = bsSel.value; + // note: style.display='none' for option elements is not supported on all browsers (notably iOS) + bsSel.replaceChildren(...bsOpts.filter(o => isM || o.dataset.type !== "2D").map(o => o.cloneNode(true))); // allow all in matrix mode, filter 2D blends otherwise + if (!bsSel.value) bsSel.value = 0; // fall back to Fade if mode is no longer available if (!isM) { - gId("filter2D").classList.add('hide'); - gId('bs').querySelectorAll('option[data-type="2D"]').forEach((o,i)=>{o.style.display='none';}); + gId("filter2D").classList.add('hide'); // hide 2D effects in non-matrix mode } else { - gId("filter2D").classList.remove('hide'); - gId('bs').querySelectorAll('option[data-type="2D"]').forEach((o,i)=>{o.style.display='';}); + gId("filter2D").classList.remove('hide'); } gId("updBt").style.display = (i.opt & 1) ? '':'none'; // if (i.noaudio) { From 9d4b3e2281450b82d52b57430d5d058fdea00725 Mon Sep 17 00:00:00 2001 From: Damian Schneider Date: Fri, 17 Apr 2026 11:14:29 +0200 Subject: [PATCH 2/2] fix default fallback --- wled00/data/index.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/wled00/data/index.js b/wled00/data/index.js index a5f5e87bd9..63ed5661ca 100644 --- a/wled00/data/index.js +++ b/wled00/data/index.js @@ -662,10 +662,9 @@ function parseInfo(i) { mh = i.leds.matrix ? i.leds.matrix.h : 0; isM = mw>0 && mh>0; if (!bsOpts) bsOpts = Array.from(gId('bs').options).map(o => o.cloneNode(true)); // snapshot all options on first call - const bsSel = gId('bs'), bsCur = bsSel.value; + const bsSel = gId('bs'); // note: style.display='none' for option elements is not supported on all browsers (notably iOS) bsSel.replaceChildren(...bsOpts.filter(o => isM || o.dataset.type !== "2D").map(o => o.cloneNode(true))); // allow all in matrix mode, filter 2D blends otherwise - if (!bsSel.value) bsSel.value = 0; // fall back to Fade if mode is no longer available if (!isM) { gId("filter2D").classList.add('hide'); // hide 2D effects in non-matrix mode } else { @@ -1461,7 +1460,9 @@ function readState(s,command=false) tr = s.transition; gId('tt').value = tr/10; - gId('bs').value = s.bs || 0; + const bsSel = gId('bs'); + bsSel.value = s.bs || 0; // assign blending style + if (!bsSel.value) bsSel.value = 0; // fall back to Fade if option does not exist if (tr===0) gId('bsp').classList.add('hide') else gId('bsp').classList.remove('hide')