Skip to content

stopGif() before .animationLoaded results in UI bug #35

@mattrabe

Description

@mattrabe

Repro steps:

  1. Hard to test without a really large animated GIF or some other way to slow load time down substantially. I used this large img from wikipedia
  2. Create 2 images in DOM within the same scope and with that large GIF: <img data-scope="testscope" data-gif="https://upload.wikimedia.org/wikipedia/commons/a/a1/Lexington_original_configuration_orig.gif" src="SomeOtherStaticGIF.gif" alt=""> <img data-scope="testscope" data-gif="https://upload.wikimedia.org/wikipedia/commons/a/a1/Lexington_original_configuration_orig.gif" src="SomeOtherStaticGIF.gif" alt="">
  3. Init using $('img').gifplayer({... wait: true ...})
  4. Open in browser, click on first GIF (which starts loading) and then quickly click the second GIF. You must click the second GIF before the first one loads completely into the DOM
  5. Wait until the large GIF is fully downloaded. You will see that the first image now disappears. This is because the onload handler within the loadGif function calls gp.previewElement.hide() once loading completes, but the stopGif function has already called this.gifElement.hide() - therefore both elements are hidden.

I'm working on a commit/PR for this right now, and will post it soon

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