-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reset FileInput value after load #958
Conversation
@@ -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 () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a playwright testcase for this change? See https://github.com/Comfy-Org/ComfyUI_frontend/tree/main/browser_tests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use
ComfyUI_frontend/browser_tests/ComfyPage.ts
Lines 326 to 331 in 2387a5e
async loadWorkflow(workflowName: string) { | |
await this.workflowUploadInput.setInputFiles( | |
this.assetPath(`${workflowName}.json`) | |
) | |
await this.nextFrame() | |
} |
e9e1120
to
21b1c78
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put the setting changes in before/after tests for proper setup/teardown, as if the test expectation fails, the setting side-effect can cause other tests to fail.
Is there a way to have the before and after functions to apply to just this test and not the |
I think the current way is to have a new describe group to hold the extra setup/teardown logic. |
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.
21b1c78
to
b8ebfcd
Compare
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.
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.
This is a long standing issue which had befuddled me for many months.