diff --git a/src/components/asignaturas/wizard/PasoBasicosForm.tsx b/src/components/asignaturas/wizard/PasoBasicosForm.tsx index dff2726..b92f5e8 100644 --- a/src/components/asignaturas/wizard/PasoBasicosForm.tsx +++ b/src/components/asignaturas/wizard/PasoBasicosForm.tsx @@ -27,14 +27,25 @@ export function PasoBasicosForm({ const [creditosInput, setCreditosInput] = useState(() => { const c = Number(wizard.datosBasicos.creditos ?? 0) - return c > 0 ? c.toFixed(2) : '' + let newC = c + console.log('antes', newC) + + if (Number.isFinite(c) && c > 999) { + newC = 999 + } + console.log('desp', newC) + return newC > 0 ? newC.toFixed(2) : '' }) const [creditosFocused, setCreditosFocused] = useState(false) useEffect(() => { if (creditosFocused) return const c = Number(wizard.datosBasicos.creditos ?? 0) - setCreditosInput(c > 0 ? c.toFixed(2) : '') + let newC = c + if (Number.isFinite(c) && c > 999) { + newC = 999 + } + setCreditosInput(newC > 0 ? newC.toFixed(2) : '') }, [wizard.datosBasicos.creditos, creditosFocused]) return ( @@ -44,6 +55,7 @@ export function PasoBasicosForm({ onChange( @@ -67,6 +79,7 @@ export function PasoBasicosForm({ onChange( @@ -123,6 +136,7 @@ export function PasoBasicosForm({ id="creditos" type="text" inputMode="decimal" + maxLength={6} pattern="^\\d*(?:[.,]\\d{0,2})?$" value={creditosInput} onKeyDown={(e) => { @@ -191,6 +205,42 @@ export function PasoBasicosForm({ /> +
+ + +

+ Define los campos requeridos (ej. Objetivos, Temario, Evaluación). +

+
+
- -
- - -

- Define los campos requeridos (ej. Objetivos, Temario, Evaluación). -

-
) } diff --git a/src/components/asignaturas/wizard/PasoDetallesPanel.tsx b/src/components/asignaturas/wizard/PasoDetallesPanel.tsx index 612d4fc..7b672f1 100644 --- a/src/components/asignaturas/wizard/PasoDetallesPanel.tsx +++ b/src/components/asignaturas/wizard/PasoDetallesPanel.tsx @@ -56,6 +56,7 @@ export function PasoDetallesPanel({