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

feat: abort downloads on unmount #996

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

feat: abort downloads on unmount #996

wants to merge 2 commits into from

Conversation

mbrevda
Copy link
Owner

@mbrevda mbrevda commented Oct 5, 2023

When the component is unmounted, attempt to cancel the image download. When using native <img /> tags, the browser does this by default. In order to test if the image is available to be displayed, we use the js Image() API and we need to tell it to stop downloading manually.

Fixes #290 by automatically canceling the download on unmount.

A preview build is available here for testing: https://github.com/mbrevda/react-image/suites/16914291077/artifacts/966242176

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.

Downloads of unmounted images aren't canceled
1 participant