mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-01-26 19:09:52 +00:00
Fix inability to select image from batch in vue (#6521)
Selecting a new image from a batch sets isLoading to true, but handleImageLoad is never triggered so the image never displays. Swapping to a different image from a batch is currently the only place isLoading is set to true. This change, even if temporary, results in a good chunk of dead code. To my understanding, ImagePreviews are always object URLs and should never need to load, so I don't foresee the loading placeholder being needed here. Resolves #6458 ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-6521-Fix-inability-to-select-image-from-batch-in-vue-29e6d73d36508162abeaeece7c5e0eed) by [Unito](https://www.unito.io)
This commit is contained in:
@@ -226,7 +226,7 @@ const setCurrentIndex = (index: number) => {
|
||||
if (index >= 0 && index < props.imageUrls.length) {
|
||||
currentIndex.value = index
|
||||
actualDimensions.value = null
|
||||
isLoading.value = true
|
||||
isLoading.value = false
|
||||
imageError.value = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -208,10 +208,6 @@ describe('ImagePreview', () => {
|
||||
await navigationDots[1].trigger('click')
|
||||
await nextTick()
|
||||
|
||||
// After clicking, component shows loading state (Skeleton), not img
|
||||
expect(wrapper.find('skeleton-stub').exists()).toBe(true)
|
||||
expect(wrapper.find('img').exists()).toBe(false)
|
||||
|
||||
// Simulate image load event to clear loading state
|
||||
const component = wrapper.vm as any
|
||||
component.isLoading = false
|
||||
|
||||
Reference in New Issue
Block a user