Skip to content

Fix: Webkit issue with cached images not triggering a load event.#2

Open
gijsroge wants to merge 2 commits into
lukeed:masterfrom
gijsroge:master
Open

Fix: Webkit issue with cached images not triggering a load event.#2
gijsroge wants to merge 2 commits into
lukeed:masterfrom
gijsroge:master

Conversation

@gijsroge

@gijsroge gijsroge commented Dec 3, 2019

Copy link
Copy Markdown

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

lukeed commented Dec 3, 2019

Copy link
Copy Markdown
Owner

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

gijsroge commented Dec 3, 2019

Copy link
Copy Markdown
Author

Done!

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

@lukeed

lukeed commented Dec 4, 2019

Copy link
Copy Markdown
Owner

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

lukeed commented Jan 2, 2020

Copy link
Copy Markdown
Owner

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

Happy new year!

@gijsroge

gijsroge commented Jan 6, 2020

Copy link
Copy Markdown
Author

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