Add null guard for querySelector and fix days using raw input value
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user