From 2377483fd714f0279ae929588d479b0c68c649b1 Mon Sep 17 00:00:00 2001 From: michaelschal <35957947-michaelschal@users.noreply.replit.com> Date: Wed, 9 Jul 2025 18:25:59 +0000 Subject: [PATCH] Show the save button at all times and improve form submission handling Fixes button visibility and adds form submission debugging with console logs in NewSaleForm.tsx. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 91318273-c764-4fd4-be04-bdc12c38af32 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/93c00a5b-c284-453f-b0ce-467e02b79bd7.jpg --- client/src/components/NewSaleForm.tsx | 29 +++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/client/src/components/NewSaleForm.tsx b/client/src/components/NewSaleForm.tsx index 1a8e823..1ef9b9e 100644 --- a/client/src/components/NewSaleForm.tsx +++ b/client/src/components/NewSaleForm.tsx @@ -85,10 +85,13 @@ export default function NewSaleForm({ onSaveSale }: NewSaleFormProps) { const onSubmit = async (data: FormData) => { try { setIsSubmitting(true); + console.log('Form data being submitted:', data); + console.log('Form errors:', form.formState.errors); // Validate required fields const missingFields = validateRequiredFields(data); if (missingFields.length > 0) { + console.log('Missing fields found:', missingFields); toast({ title: "Champs manquants", description: `Veuillez remplir: ${missingFields.join(', ')}`, @@ -527,13 +530,31 @@ export default function NewSaleForm({ onSaveSale }: NewSaleFormProps) { - {/* Form Actions */} -
- -