-
Notifications
You must be signed in to change notification settings - Fork 14
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
Query not applied to initial page load #15
Comments
I'm having this same problem. Can you post some sample code as to how to got around it? I can't seem to find a working workaround. |
Nevermind, I misread your workaround and didn't understand it at first. For future reference, here's how @suryagaddipati's workaround looks like in code:
|
Another workaround that worked for me is to set default app.smallScreen = false;
|
+1 Running into the same problem. When you say "set default false on app object" @vorotech (or @suryagaddipati), do you mean set the databound property (smallScreen in this example) in the element's 'ready' event using js? What if this isn't at the 'app' level per say, but rather the iron-media-query handling is done within a nested polymer element? I've also tried setting a default value of false in the element's property declaration as follows, to no avail: ps: In my situation, I'm not using a dom-if template. I am simply hiding or showing various Local DOM elements using |
This is causing me all sorts of issues. Any other suggestions given my situation above? @notwaldorf perhaps? |
This sounds like a timing issue; however I couldn't repro the issue. tested in chrome, mobile safari, safari, firefox. Maybe we fixed this issue in Polymer a long time ago? Could you guys send a code that reproduces the issue? |
@blasten I've been busy trying to get you a jsbin demonstrating replication of this issue. Initially, I was having some trouble replicating in jsbin, but I think I might be on the right track now. It appears it could have something to do with having the hidden$={{smallScreen}} applied on a tag inside an iron-list templated item. If I remove the iron-list, the issue of the iron-media-query not working on initial page load goes away. I'll continue down this rabbit hole to try to get you a jsbin (or perhaps even determine root cause), but wanted to let you know in the meantime, in case something comes to your mind or you can suggest what might be causing the problem with the iron-media-query not playing well with iron-list on initial page load. |
Ok, here is the reproduction of the issue in jsbin: http://jsbin.com/vapopa/1/edit?html,output |
@Sinjins This issue is confirmed, but I'm moving it to PolymerElements/iron-list#107. Feel free to reopen this issue if you have a repro code using iron-media-query only. |
!queryMatches
is not triggered with initial page load .https://elements.polymer-project.org/elements/iron-media-query?view=demo:demo/index.html
this page text is empty if you load it on iphone emulator for example.
Not sure if this is expected behavior.
The workaround is to use two matchers without the
!queryMatches
The text was updated successfully, but these errors were encountered: