[Desktop] Re-run path validation when re-focusing installation location input (#2528)

This commit is contained in:
bymyself
2025-02-12 08:02:42 -07:00
committed by GitHub
parent bfec9b692b
commit 9fd73873b6

View File

@@ -17,6 +17,7 @@
class="w-full"
:class="{ 'p-invalid': pathError }"
@update:modelValue="validatePath"
@focus="onFocus"
/>
<InputIcon
class="pi pi-info-circle"
@@ -81,6 +82,7 @@ const pathError = defineModel<string>('pathError', { required: true })
const pathExists = ref(false)
const appData = ref('')
const appPath = ref('')
const inputTouched = ref(false)
const electron = electronAPI()
@@ -132,4 +134,13 @@ const browsePath = async () => {
pathError.value = t('install.failedToSelectDirectory')
}
}
const onFocus = () => {
if (!inputTouched.value) {
inputTouched.value = true
return
}
// Refresh validation on re-focus
validatePath(installPath.value)
}
</script>