iron-image icon indicating copy to clipboard operation
iron-image copied to clipboard

Loaded never changes when url encoded img.src differs from provided src

Open ArthurJahn opened this issue 7 years ago • 0 comments

Description

When the src provided contains white spaces or special chars, the image.$.img.src and src differs. This causes the _imgOnLoad and _imgOnError validation to return and not propagate the loaded, loading and error properties.

Just changed this:

if (this.$.img.src !== this._resolveSrc(this.src)) {
          return;
}
//[...]

To this:

if (decodeURI(this.$.img.src) !== this._resolveSrc(this.src)) {
          return;
}
//[...]

And fixed it. Let me know if this should be the solution to this issue.

Expected outcome

Placeholder to be presented and then the image when loaded.

Actual outcome

Placeholder is presented but the image never loads.

Steps to reproduce

Provide an image src with white spaces and a placeholder.

Browsers Affected

  • [x] Chrome
  • [x] Firefox
  • [x] Safari 10
  • [ ] Safari 9
  • [ ] Edge
  • [ ] IE 11

ArthurJahn avatar Jan 26 '18 14:01 ArthurJahn