Fix validazione input: allinea min con step per sub-unità (50g ora funziona)

This commit is contained in:
dadaloop82
2026-03-13 14:56:35 +00:00
parent 6c9fade761
commit ac76d02cb6
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -3038,6 +3038,7 @@ function switchUseUnit(mode) {
const step = getSubUnitStep(_useConfMode.packageUnit);
qtyInput.value = step;
qtyInput.step = step;
qtyInput.min = step;
hint.textContent = `Quantità in ${_useConfMode.subLabel} (totale: ${Math.round(_useConfMode.totalSub)}${_useConfMode.subLabel})`;
} else {
confBtn.classList.add('active');
@@ -3045,6 +3046,7 @@ function switchUseUnit(mode) {
_useConfMode._activeUnit = 'conf';
qtyInput.value = 1;
qtyInput.step = 0.5;
qtyInput.min = 0.5;
hint.textContent = `Confezioni da ${_useConfMode.packageSize}${_useConfMode.subLabel} (hai ${_useConfMode.totalConf.toFixed(1)} conf)`;
}
}