-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[dom-if] is not as inert as <template> should be #1695
Comments
@andrewebdev There is some non-documented (as of yet) feature in the dom-if template. https://github.com/Polymer/polymer/blob/master/src/lib/template/dom-if.html#L57 If you set
|
Not exactly undocumented. It's described here: https://www.polymer-project.org/1.0/docs/devguide/templates.html#dom-if And in the API reference under |
@arthurevans You are correct. It is documented, which makes sense since it is documented in the code and the docs seem to be autogenerated. |
@clintonjrobinson thank you very much; I must've missed that somehow. That said this still doesn't resolve the main reason I logged this issue. The content enclosed in the template tag is not entirely inert, as it was in 0.5. This approach to using the template to request only one of the images, worked fine in 0.5. EDIT: Scrap that, I'm talking bollocks. Just reviewed my old implementation and is not that network friendly as I thought. I mistook it for a different implementation where I actually passed in the different src urls as attributes, not as img tags. |
In 0.5, using a mix of media queries and I was able to create a component that would only load a specific based on said media queries. I've attempted to replicate this element in 1.0, unfortunately without success.
I have a Stack Overflow post here: http://stackoverflow.com/questions/30557315/polymer-1-0-dom-if-does-not-recalculate-when-previously-true
What I'm expecting is to see only one image displayed on the page based on the media query, with only one image requested over the network.
What I'm actually getting: All 4 images are requested at load time, and resizing the window does not get rid of a previously stamped template, which should now be hidden (so, 2 or more images ends up being visible on page, after resizing)
The text was updated successfully, but these errors were encountered: