Skip to content

IE11 not working when empty src AND data-sizes="auto" #388

Closed
@wearetelescopic

Description

@wearetelescopic

This is more an FYI in case anyone else stumbles over this:

There's an odd one we've resolved with a workaround of making sure there's never an empty src attribute on the image. This happened because we usually have a placeholder for the aspect ratio display and then all sizes in data-src. So this:

Doesn't load in IE11. Works in all other browsers. It seems to stop on the isAuto check.

It works if I either remove data-sizes="auto" OR the empty src tag, so the solution is to make sure that there's never an empty src tag:

Activity

aFarkas

aFarkas commented on May 18, 2017

@aFarkas
Owner

@wearetelescopic
I haven't fully understood the problem. But can you please give me a testcase, which shows the problematic markup with the resulting non-working behavior?

andalusi

andalusi commented on May 29, 2017

@andalusi

I have the same issue.
Using lazysizes with data-bgset.
In IE11 the class lazyload doesn't switch to lazyloaded.

All other browsers doing well.

Live example here:
draufsicht.com

aFarkas

aFarkas commented on May 30, 2017

@aFarkas
Owner

@andalusi
Not really checked everything, but you know that this should only work in IE11 using either picturefill or the respimg polyfill plugin (and these are referenced)?

andalusi

andalusi commented on Jun 3, 2017

@andalusi

@aFarkas You are right, thanks!

wearetelescopic

wearetelescopic commented on Jun 5, 2017

@wearetelescopic
Author
aFarkas

aFarkas commented on Jun 5, 2017

@aFarkas
Owner

@wearetelescopic

I can fix this issue, but this is really a markup pattern that you should never use. (See he for some background information: https://www.nczonline.net/blog/2009/11/30/empty-image-src-can-destroy-your-site/)

added a commit that references this issue on Jun 5, 2017
5d79d0f
wearetelescopic

wearetelescopic commented on Jun 5, 2017

@wearetelescopic
Author

Thanks! Yeah that came up in development - the image markup is dynamically generated and the src tag usually just holds a tiny placeholder which in this case was missing but caused the whole thing to not work on ie11 testing. So this was a bit of an edge case and required some detective work to figure out what the hell was going on.
Just thought it might be useful to note down in here in case anyone else comes across this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      IE11 not working when empty src AND data-sizes="auto" · Issue #388 · aFarkas/lazysizes