From c2ffe08db5638bfca778f7eb143b76f6e297d38a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cau=C3=AA=20Faleiros?= Date: Tue, 1 Dec 2026 11:41:08 -0300 Subject: [PATCH] fix: Escolher datas stays open when the numbers reload (tab opened, 7/30/90, the 30 s refresh) statsPeriod redrew the period bar with replaceChildren, which dropped an open calendar. On a phone the numbers' reply often lands after the tap, so the calendar opened and vanished at once: "Escolher datas" seemed to do nothing. Co-Authored-By: Claude Opus 5.5 --- web/kanban-numbers.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/web/kanban-numbers.js b/web/kanban-numbers.js index d0b8a51..4abf90e 100644 --- a/web/kanban-numbers.js +++ b/web/kanban-numbers.js @@ -30,7 +30,11 @@ function statsPeriod(){ const open=node('button',undefined,'btn'+(statsRange?' on':''));open.type='button';open.setAttribute('aria-haspopup','dialog'); open.append(svgIcon(IC.calendar,'i m'),statsRange?shortDay(statsRange.start)+' a '+shortDay(statsRange.end):'Escolher datas'); open.onclick=e=>{e.stopPropagation();const pop=wrap.querySelector('.pop');if(pop){pop.remove();return;}wrap.append(calendar());}; - wrap.replaceChildren(open); + // The numbers reload when the tab opens, on 7/30/90 and every 30 s: a + // calendar open meanwhile stays (on a phone the reply came after the tap + // and closed it, so "Escolher datas" seemed to do nothing). + const pop=wrap.querySelector('.pop'); + wrap.replaceChildren(open,...(pop?[pop]:[])); } // The calendar: presets on the left, a month where a click starts the // period and the next one ends it. `single`, `future` and `time` add the