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 bug where images loaded from chrome cache results in 0 WIDTH elements #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BrunoRB
Copy link

@BrunoRB BrunoRB commented Mar 1, 2017

In some chrome versions (linux 54.0 being one of them) sometimes the getComputedStyle(data.target[0]).width call in Spin.setLayout returns the value auto which makes the image width value 0 ( w = Number(style.width.replace('px', ''))|0; === 0), thus making it invisible.
It usually happens when spritesbin fully loaded the images, then you change to another page and then you go back to the previous page using the browser back button. My best guess is that chrome triggers the img.onload event for cached images without (or before) computing the image dimensions.

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.

1 participant