Fix stopwatch fill button not updating addAmt state

Setting inp.value programmatically bypasses the oninput handler that
syncs addAmt[k], so addSet read 0. Firing the input event after fill
ensures the value is registered.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Simon Kühn 2026-05-01 10:23:41 +02:00
parent c9e8f69c3f
commit 88cc05e999

View file

@ -993,7 +993,7 @@ var sw = (function(){
document.addEventListener('click', function(e){ document.addEventListener('click', function(e){
if(!e.target.classList.contains('btn-sw-fill')) return; if(!e.target.classList.contains('btn-sw-fill')) return;
var inp = e.target.closest('.add-row, .qb-row').querySelector('.num-in'); var inp = e.target.closest('.add-row, .qb-row').querySelector('.num-in');
if(inp) inp.value = Math.floor(getMs() / 1000); if(inp){ inp.value = Math.floor(getMs() / 1000); inp.dispatchEvent(new Event('input')); }
}); });
return { getMs: getMs }; return { getMs: getMs };