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

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 join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant