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;
|
tUnits.value[dsp].val = decoratedInputValue;
|
||||||
switch (dsp) {
|
switch (dsp) {
|
||||||
case "d":
|
case "d":
|
||||||
days.value = baseInputValue;
|
days.value = decoratedInputValue;
|
||||||
break;
|
break;
|
||||||
case "h":
|
case "h":
|
||||||
hours.value = decoratedInputValue;
|
hours.value = decoratedInputValue;
|
||||||
@@ -297,7 +297,7 @@ function incrementPreviousUnit(input) {
|
|||||||
const prevUnit = document.querySelector(
|
const prevUnit = document.querySelector(
|
||||||
`input[data-index="${parseInt(input.dataset.index) - 1}"]`,
|
`input[data-index="${parseInt(input.dataset.index) - 1}"]`,
|
||||||
);
|
);
|
||||||
actionUpDown(prevUnit, true);
|
if (prevUnit) actionUpDown(prevUnit, true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user