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

Image: fix a race condition if src changes too frequently #18837

Closed
wants to merge 1 commit into from

Conversation

gdh1995
Copy link

@gdh1995 gdh1995 commented Feb 21, 2020

Everytime src changes,
loadImage will create a new HTMLImageElement to detect errors,
so if src changes again before the before gets loaded/broken,
then error can be trapped in a wrong status.

Please make sure these boxes are checked before submitting your PR, thank you!

  • Make sure you follow Element's contributing guide (中文 | English | Español | Français).
  • Make sure you are merging your commits to dev branch.
  • Add some descriptions and refer relative issues for you PR.

Everytime `src` changes,
`loadImage` will create a new `HTMLImageElement` to detect errors,
so if `src` changes again before the before gets loaded/broken,
then `error` can be trapped in a wrong status.
@element-bot
Copy link
Member

Deploy preview for element ready!

Built with commit ea99b7b

https://deploy-preview-18837--element.netlify.com

CarterLi added a commit to CarterLi/element that referenced this pull request Mar 30, 2020
1.  set preview `:initial-index` to `0` if src is not in previewSrcList
ElemeFE#18871
and also fix preview example
2. fix ESC won't close preview for the second time
ElemeFE#19027
ElemeFE#18906
3. fix undesired `overflow: scroll` style
ElemeFE#18967
4. fix a race condition if src changes too frequently
ElemeFE#18837
5. add `close-on-click-modal` prop
ElemeFE#18947
ZJL8 pushed a commit to EOITek/element that referenced this pull request Mar 30, 2020
1.  set preview `:initial-index` to `0` if src is not in previewSrcList
ElemeFE#18871
and also fix preview example
2. fix ESC won't close preview for the second time
ElemeFE#19027
ElemeFE#18906
3. fix undesired `overflow: scroll` style
ElemeFE#18967
4. fix a race condition if src changes too frequently
ElemeFE#18837
5. add `close-on-click-modal` prop
ElemeFE#18947
@stale
Copy link

stale bot commented Jun 16, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 16, 2021
@gdh1995 gdh1995 closed this Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants