fix: Controlla se `reportValidity` esiste
This commit is contained in:
parent
64342f8aaa
commit
8af4c44e3f
|
@ -113,7 +113,7 @@ export async function showSnackbar(
|
|||
export function isFormValid(form: HTMLFormElement): boolean {
|
||||
let isValid = true;
|
||||
for (const element of form.elements) {
|
||||
if (!(element as HTMLInputElement).reportValidity()) {
|
||||
if (typeof (element as HTMLInputElement).reportValidity === 'function' && !(element as HTMLInputElement).reportValidity()) {
|
||||
isValid = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue