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: Webkit issue with cached images not triggering a load event. #2

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

Conversation

gijsroge
Copy link

@gijsroge gijsroge commented Dec 3, 2019

We had an issue where in safari images would not appear when they are cached in the browser.

This pull request applies a small "hack" to fix this in Webkit.

Source:
https://stackoverflow.com/questions/5024111/javascript-image-onload-doesnt-fire-in-webkit-if-loading-same-image

@lukeed
Copy link
Owner

lukeed commented Dec 3, 2019

Hey, thanks!

Few things:

  1. Can you remove the changes from dist/*? They're built / auto-generated
  2. Have you tried the other approach mentioned in the SO link? Setting el.src=''; then reassigning?

Thanks :)

@gijsroge
Copy link
Author

gijsroge commented Dec 3, 2019

Done!

I used the yarn build command to generate the dist folder? Is this done somewhere else or?

@lukeed
Copy link
Owner

lukeed commented Dec 4, 2019

Thanks! Yes, I'll run it locally before deploying.

So, you can confirm that this new approach still solves the issue you experienced with Safari? (I couldn't reproduce)

@lukeed
Copy link
Owner

lukeed commented Jan 2, 2020

Hey sorry, quick check on this: Did the new approach still work in Safari for you?

Happy new year!

@gijsroge
Copy link
Author

gijsroge commented Jan 6, 2020

Yes sorry, i haven't been much at work so didn't double check yet.. i'll keep you posted.

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