mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-01 19:20:10 +00:00
[bugfix] Fix double-click required after pasting URL in upload model dialog (#6801)
## Summary Fixed an issue where users had to click twice to continue after pasting a URL in the upload model dialog - once to blur the input, then again to click the button. ## Changes - **What**: Replaced `UrlInput` with plain `InputText` in `UploadModelUrlInput` to emit value immediately on input instead of only on blur - **Cleanup**: Moved URL cleaning/normalization to the `fetchMetadata` handler, removed unused `disableValidation` prop from `UrlInput` component ## Review Focus - URL normalization logic in `useUploadModelWizard.ts` 🤖 Generated with [Claude Code](https://claude.com/claude-code) ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6801-bugfix-Fix-double-click-required-after-pasting-URL-in-upload-model-dialog-2b26d73d3650811881aed0cc064efcc7) by [Unito](https://www.unito.io) --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
parent
6e2e591937
commit
ff0d385db8
@@ -62,6 +62,15 @@ export function useUploadModelWizard(modelTypes: Ref<ModelTypeOption[]>) {
|
||||
async function fetchMetadata() {
|
||||
if (!canFetchMetadata.value) return
|
||||
|
||||
// Clean and normalize URL
|
||||
let cleanedUrl = wizardData.value.url.trim()
|
||||
try {
|
||||
cleanedUrl = new URL(encodeURI(cleanedUrl)).toString()
|
||||
} catch {
|
||||
// If URL parsing fails, just use the trimmed input
|
||||
}
|
||||
wizardData.value.url = cleanedUrl
|
||||
|
||||
if (!isCivitaiUrl(wizardData.value.url)) {
|
||||
uploadError.value = st(
|
||||
'assetBrowser.onlyCivitaiUrlsSupported',
|
||||
|
||||
Reference in New Issue
Block a user