mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-03-07 22:20:03 +00:00
Reset FileInput value after load (#958)
When a file is browsed for, the fileInput remains associated with the chosen file even after the associated workflow is loaded. If a user attempts to load the same file again, the onchange event does not fire and loading fails silently. This is fixed by clearing the fileInput after the workflow has been loaded. Out of an abundance of caution, the onchange is made async to ensure the fileInput isn't cleared until after the workflow has loaded. Add a test to check if the same workflow file can be loaded consecutively.
This commit is contained in:
@@ -382,8 +382,9 @@ export class ComfyUI {
|
||||
accept: '.json,image/png,.latent,.safetensors,image/webp,audio/flac',
|
||||
style: { display: 'none' },
|
||||
parent: document.body,
|
||||
onchange: () => {
|
||||
app.handleFile(fileInput.files[0])
|
||||
onchange: async () => {
|
||||
await app.handleFile(fileInput.files[0])
|
||||
fileInput.value = ''
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user