From 9969cc9edc7b5393afc49f1c965edd316a307cf4 Mon Sep 17 00:00:00 2001 From: solocla Date: Tue, 28 Oct 2025 09:31:13 +0100 Subject: [PATCH] partstable fixed matrici dropdown --- public/userarea/partsTable.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/public/userarea/partsTable.js b/public/userarea/partsTable.js index 74a4e1a..399db03 100644 --- a/public/userarea/partsTable.js +++ b/public/userarea/partsTable.js @@ -1474,8 +1474,8 @@ $(document).ready(function () { }, }); - // Ripristina il valore se valido - if (partId && partId !== "new" && currentValue) { + // === MODIFICA CHIRURGICA: solo qui === + if (currentValue && currentValue !== "new") { const matrice = matrici.find((m) => m.IdMatrice == currentValue); if (matrice) { const option = new Option( @@ -1487,11 +1487,15 @@ $(document).ready(function () { $select.append(option).trigger("change"); partMatrice[partNumber] = matrice.IdMatrice; } else { - // Aggiusta valore non valido $select.val(null).trigger("change"); partMatrice[partNumber] = null; } + } else { + // Nessun valore: assicurati che sia vuoto + $select.val(null).trigger("change"); + partMatrice[partNumber] = null; } + // === FINE MODIFICA === $select.on("change", function () { const idmatrice = $(this).val();