turbolinks / turbolinks-classic

Classic version of Turbolinks. Now deprecated in favor of Turbolinks 5.
MIT License
3.54k stars 428 forks source link

Masonry Images do not show on mobile iOS Safari when using 'back' history button #636

Closed Buildzzz closed 8 years ago

Buildzzz commented 8 years ago

I'm having an issue where my images wrapped in a masonry grid block are not showing up when I use the 'back' button on mobile iOS Safari.

I can click on refresh and the images show up again as expected. I can also click on 'fwd' and then 'back' and the images seem to be there which is just perplexing. It is only when I use the default 'back' button in Safari for the first time that the images don't show up.

I had issues with this on other images before when using turbolinks and I solved them by making all links going to that page data-no-turbolinks. However, this issue is that users are using the default 'back' button in the browsers so we can't disable turbolinks for that. (At least I dont know how)

I am calling my images through this basic link_to: <%= link_to image_tag(@listing.image.url(:medium), alt: "image1" %>

I tried adding alerts to diagnose. The page:load and page:change are being sent by turbolinks to the Safari browser as expected, but the images never get reloaded.

I'm storing and grabbing the images from a S3 bucket. This issue is for Sarai and Firefox browsers on mobile. Chrome mobile browser works and desktop has no issues.

Please help! Thx

Thibaut commented 8 years ago

This sounds like an issue with Masonry. You could also ask on StackOverflow (we don't offer support here, sorry).