Skip to content
This repository has been archived by the owner on Dec 28, 2024. It is now read-only.

natural{Width,Height}? #144

Open
davidmaxwaterman opened this issue May 7, 2019 · 0 comments
Open

natural{Width,Height}? #144

davidmaxwaterman opened this issue May 7, 2019 · 0 comments

Comments

@davidmaxwaterman
Copy link

Description

It seems a little awkward to get the equivalent of an 's naturalWidth and naturalHeight properties. It seems like you need to go into the shadowRoot, something like this, where #img is the id of the iron-image:

$0.shadowRoot.querySelector('#img').naturalHeight

I guess I could also create an Image() with the same URL and test the properties on that.

Expected outcome

I expect properties on the iron-image element.

Actual outcome

Have to dig into the shadow dom, or create another object.

Live Demo

That URL seems to be broken, so my demo is also:

https://jsbin.com/bovihujawa/edit?html,output

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant