From b10fcc057ea2287515235bf193fa5ecad0fc5257 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Mon, 9 Mar 2026 17:10:15 +0800 Subject: [PATCH] Add null guard for querySelector and fix days using raw input value Co-Authored-By: Claude Opus 4.6 --- src/components/DurationInput.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/DurationInput.vue b/src/components/DurationInput.vue index ef03e1c..e75e736 100644 --- a/src/components/DurationInput.vue +++ b/src/components/DurationInput.vue @@ -216,7 +216,7 @@ function onChange(event) { tUnits.value[dsp].val = decoratedInputValue; switch (dsp) { case "d": - days.value = baseInputValue; + days.value = decoratedInputValue; break; case "h": hours.value = decoratedInputValue; @@ -297,7 +297,7 @@ function incrementPreviousUnit(input) { const prevUnit = document.querySelector( `input[data-index="${parseInt(input.dataset.index) - 1}"]`, ); - actionUpDown(prevUnit, true); + if (prevUnit) actionUpDown(prevUnit, true); } }