From 46d58ce2078434af1b1a7e5ff31c8879db1ceb52 Mon Sep 17 00:00:00 2001
From: skjnldsv <skjnldsv@protonmail.com>
Date: Wed, 29 Jan 2025 11:23:44 +0100
Subject: fix(files_sharing): file request form validity check reset

Signed-off-by: skjnldsv <skjnldsv@protonmail.com>

Signed-off-by: nextcloud-command <nextcloud-command@users.noreply.github.com>
---
 apps/files_sharing/src/components/NewFileRequestDialog.vue | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

(limited to 'apps/files_sharing/src/components/NewFileRequestDialog.vue')

diff --git a/apps/files_sharing/src/components/NewFileRequestDialog.vue b/apps/files_sharing/src/components/NewFileRequestDialog.vue
index 893830ca98e..03bc0007769 100644
--- a/apps/files_sharing/src/components/NewFileRequestDialog.vue
+++ b/apps/files_sharing/src/components/NewFileRequestDialog.vue
@@ -218,10 +218,9 @@ export default defineComponent({
 	methods: {
 		onPageNext() {
 			const form = this.$refs.form as HTMLFormElement
-			if (!form.checkValidity()) {
-				form.reportValidity()
-				return
-			}
+
+			// Reset custom validity
+			form.querySelectorAll('input').forEach(input => input.setCustomValidity(''))
 
 			// custom destination validation
 			// cannot share root
@@ -232,6 +231,12 @@ export default defineComponent({
 				return
 			}
 
+			// If the form is not valid, show the error message
+			if (!form.checkValidity()) {
+				form.reportValidity()
+				return
+			}
+
 			if (this.currentStep === STEP.FIRST) {
 				this.currentStep = STEP.SECOND
 				return
-- 
cgit v1.2.3

