mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-29 10:42:44 +00:00
[Desktop] Re-run path validation when re-focusing installation location input (#2528)
This commit is contained in:
@@ -17,6 +17,7 @@
|
|||||||
class="w-full"
|
class="w-full"
|
||||||
:class="{ 'p-invalid': pathError }"
|
:class="{ 'p-invalid': pathError }"
|
||||||
@update:modelValue="validatePath"
|
@update:modelValue="validatePath"
|
||||||
|
@focus="onFocus"
|
||||||
/>
|
/>
|
||||||
<InputIcon
|
<InputIcon
|
||||||
class="pi pi-info-circle"
|
class="pi pi-info-circle"
|
||||||
@@ -81,6 +82,7 @@ const pathError = defineModel<string>('pathError', { required: true })
|
|||||||
const pathExists = ref(false)
|
const pathExists = ref(false)
|
||||||
const appData = ref('')
|
const appData = ref('')
|
||||||
const appPath = ref('')
|
const appPath = ref('')
|
||||||
|
const inputTouched = ref(false)
|
||||||
|
|
||||||
const electron = electronAPI()
|
const electron = electronAPI()
|
||||||
|
|
||||||
@@ -132,4 +134,13 @@ const browsePath = async () => {
|
|||||||
pathError.value = t('install.failedToSelectDirectory')
|
pathError.value = t('install.failedToSelectDirectory')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const onFocus = () => {
|
||||||
|
if (!inputTouched.value) {
|
||||||
|
inputTouched.value = true
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Refresh validation on re-focus
|
||||||
|
validatePath(installPath.value)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user