allaw-ui 5.3.2 → 5.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -81,10 +81,13 @@ var Input = forwardRef(function (_a, ref) {
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
console.log("[Input".concat(title ? " \"".concat(title, "\"") : "", "] validateInput - errorMessage:"), errorMessage, "propError:", propError);
|
|
84
|
-
|
|
84
|
+
// Si validation interne échoue, afficher l'erreur interne
|
|
85
|
+
// Sinon, préserver l'erreur RHF du prop propError
|
|
86
|
+
var finalError = errorMessage || propError || "";
|
|
87
|
+
setError(finalError);
|
|
85
88
|
setIsTouched(true);
|
|
86
89
|
onError === null || onError === void 0 ? void 0 : onError(errorMessage);
|
|
87
|
-
console.log("[Input".concat(title ? " \"".concat(title, "\"") : "", "] validateInput APR\u00C8S setError, error state will be:"),
|
|
90
|
+
console.log("[Input".concat(title ? " \"".concat(title, "\"") : "", "] validateInput APR\u00C8S setError, error state will be:"), finalError);
|
|
88
91
|
return !errorMessage;
|
|
89
92
|
}, [isRequired, value, validate, onError, propError, title]);
|
|
90
93
|
// Forcer la validation quand forceShowErrors devient true
|