fix access to form in checkValidity

This commit is contained in:
Girish Ramakrishnan
2025-12-05 17:36:48 +01:00
parent 620974217a
commit c8842cc71f
11 changed files with 23 additions and 22 deletions
+5 -5
View File
@@ -25,8 +25,8 @@ const encryptionPassword = ref('');
const encryptedFilenames = ref(false);
const isFormValid = ref(false);
function validateForm() {
isFormValid.value = form.value && form.value.checkValidity();
function checkValidity() {
isFormValid.value = form.value ? form.value.checkValidity() : false;
}
async function onSubmit() {
@@ -251,7 +251,7 @@ function onBackupConfigChanged(event) {
}
}
setTimeout(validateForm, 100); // update state of the confirm button
setTimeout(checkValidity, 100); // update state of the confirm button
};
reader.readAsText(event.target.files[0]);
@@ -262,7 +262,7 @@ function onUploadBackupConfig() {
}
watchEffect(() => {
if (providerConfig.value.credentials) setTimeout(validateForm, 100);
if (providerConfig.value.credentials) setTimeout(checkValidity, 100);
});
defineExpose({
@@ -310,7 +310,7 @@ defineExpose({
</button>
</p>
<form @submit.prevent="onSubmit()" autocomplete="off" ref="form" @input="validateForm()">
<form @submit.prevent="onSubmit()" autocomplete="off" ref="form" @input="checkValidity()">
<fieldset :disabled="busy">
<input style="display: none;" type="submit"/>