noph-ui 0.18.8 → 0.18.9
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.
package/dist/text-field/index.js
CHANGED
|
@@ -2,6 +2,9 @@ export const isFirstInvalidControlInForm = (form, control) => {
|
|
|
2
2
|
if (!form) {
|
|
3
3
|
return true;
|
|
4
4
|
}
|
|
5
|
+
return getFirstInvalidControlInForm(form) === control;
|
|
6
|
+
};
|
|
7
|
+
export const getFirstInvalidControlInForm = (form) => {
|
|
5
8
|
let firstInvalidControl;
|
|
6
9
|
for (const element of form.elements) {
|
|
7
10
|
if (element.matches(':invalid')) {
|
|
@@ -9,5 +12,5 @@ export const isFirstInvalidControlInForm = (form, control) => {
|
|
|
9
12
|
break;
|
|
10
13
|
}
|
|
11
14
|
}
|
|
12
|
-
return firstInvalidControl
|
|
15
|
+
return firstInvalidControl;
|
|
13
16
|
};
|