Skip to content
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

fix: ImagePreview refresh problem when onload of multiple pictures is triggered at the same time #173

Merged
merged 1 commit into from
Sep 21, 2023

Conversation

yeling
Copy link
Contributor

@yeling yeling commented Sep 15, 2023

问题描述:多张图片组件预览时,第一次打开黑屏,图片不显示
问题分析:
setImagesStatusByIndex setImagesStatus
如果两张图片的onload事件同时到达,此时render没有来得刷新,会出现在一次render期间
setImagesStatus被调用两次,
第一次刷新时根据 imagesStatusRef.current 来计算
setImagesStatus 之后imagesStatusRef.current值没有立即改变
第二次刷新时也根据 imagesStatusRef.current 来计算
覆盖了第一次刷新的结果,导致第一张图片的loaded状态一直为false

@TinaPeach TinaPeach changed the title fix: image-preview refresh problem fix: ImagePreview refresh problem when onload of multiple pictures is triggered at the same time Sep 21, 2023
@TinaPeach TinaPeach merged commit c71c526 into arco-design:main Sep 21, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants