allaw-ui 5.2.9 → 5.3.1
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.
|
@@ -63,8 +63,9 @@ var Input = forwardRef(function (_a, ref) {
|
|
|
63
63
|
setValue(propValue || "");
|
|
64
64
|
}, [propValue]);
|
|
65
65
|
useEffect(function () {
|
|
66
|
+
console.log("[Input".concat(title ? " \"".concat(title, "\"") : "", "] error prop received:"), propError || "");
|
|
66
67
|
setError(propError || "");
|
|
67
|
-
}, [propError]);
|
|
68
|
+
}, [propError, title]);
|
|
68
69
|
var validateInput = useCallback(function () {
|
|
69
70
|
var _a;
|
|
70
71
|
// console.log(`Input ${title}: Validating input`);
|
|
@@ -120,14 +121,20 @@ var Input = forwardRef(function (_a, ref) {
|
|
|
120
121
|
return __generator(this, function (_a) {
|
|
121
122
|
switch (_a.label) {
|
|
122
123
|
case 0:
|
|
124
|
+
console.log("[Input".concat(title ? " \"".concat(title, "\"") : "", "] blur event detected"));
|
|
123
125
|
// Marquer le champ comme touché
|
|
124
126
|
setIsTouched(true);
|
|
125
127
|
// Valider en interne d'abord
|
|
126
128
|
validateInput();
|
|
127
129
|
if (!onBlur) return [3 /*break*/, 2];
|
|
130
|
+
console.log("[Input".concat(title ? " \"".concat(title, "\"") : "", "] Calling onBlur callback"));
|
|
128
131
|
return [4 /*yield*/, onBlur()];
|
|
129
132
|
case 1:
|
|
130
133
|
_a.sent();
|
|
134
|
+
console.log("[Input".concat(title ? " \"".concat(title, "\"") : "", "] onBlur callback completed, re-validating to display error"));
|
|
135
|
+
// RE-VALIDER après que onBlur ait mis à jour le prop error
|
|
136
|
+
// Cela force le re-render avec l'erreur RHF visible
|
|
137
|
+
validateInput();
|
|
131
138
|
_a.label = 2;
|
|
132
139
|
case 2: return [2 /*return*/];
|
|
133
140
|
}
|