react-lazy-load-image-component icon indicating copy to clipboard operation
react-lazy-load-image-component copied to clipboard

Images keep loading even image is not part of the DOM anymore (Switching pages/views)

Open rkkoszewski opened this issue 1 year ago • 0 comments

Bug description I'm using react-lazy-load-image-component. I have several bigger images that are loading and it can take several seconds for it to finish downloading. When I click on a link while an image is loading, the image keeps downloading in the background while the image element is not part of the DOM anymore.

I'd expect the loading of the image to be cancelled when the image element is removed from the DOM.

To Reproduce Create a lazy loaded image element, and a link that just removes that image element. Throttle the download speed and remove the image element while it's loading, and see that in the web browser network view you can still see the image downloading.

Technical details:

  • Device [Desktop/Smartphone]: Both
  • Operating System [e.g. Windows, Mac OS, GNU/Linux]: Tested in Windows and Android
  • Browser [e.g. Firefox, Chrome, Safari]: Tested in Chrome and Edge

rkkoszewski avatar Dec 15 '22 15:12 rkkoszewski