Populating a core-list throws an error if the tab is not in focus

54 views
Skip to first unread message

Viktor Kojouharov

unread,
Dec 1, 2014, 3:29:16 AM12/1/14
to polym...@googlegroups.com
Hi,

I'm running into an error when my app loads, but the tab is not actually in focus. Core list throws this error:
 Uncaught TypeError: Cannot set property 'model' of undefined
And then this one, though it might be as a result of the previous one:
 Uncaught TypeError: Cannot read property '_translateY' of undefined

I sort of recall that polymer now doesn't do any worn when the tab is not in focus, so my question is, what's the proper way to make sure that populating the list won't throw errors?

AJ Ortega

unread,
Dec 1, 2014, 4:21:09 AM12/1/14
to Viktor Kojouharov, polym...@googlegroups.com
Does your core-list have a scrollTarget set? If you're using core-pages for your tabs, you should set that as the core-list's scrolltarget.

Something like <core-list scrollTarget="{{$.idOfScrollTarget}}" should fix your issue.

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/82bc4166-70a0-4f34-a4ec-0d2eeec434b4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
AJ Ortega | Software Engineer | a...@google.com | 626-872-5064 

Viktor Kojouharov

unread,
Dec 1, 2014, 5:59:14 AM12/1/14
to polym...@googlegroups.com, vkojo...@gmail.com
It has a scrollTarget, though I'm setting it in the 'domReady' method of the component which holds the list:

and its set to the scaffolding's container for the main content. I didn't find a 'proper' way of setting it in the html itself, probably due to ignorance on my part.

AJ Ortega

unread,
Dec 1, 2014, 6:05:55 AM12/1/14
to Viktor Kojouharov, polym...@googlegroups.com
Is this your list? https://github.com/urandom/readeef/blob/0393599c143f1bea8583fc9c8b44c16778a53bf1/templates/components/rf-content-list.tmpl#L24

If so, you should be able to add the attribute scrollTarget="{{$.pages}}" to the core-list defined there, and it *should* work.


For more options, visit https://groups.google.com/d/optout.

Viktor Kojouharov

unread,
Dec 1, 2014, 6:11:14 AM12/1/14
to polym...@googlegroups.com, vkojo...@gmail.com
Yes it is. Would the 'pages' as a target be correct though, as its not technically scrolling. The scaffolding container is the actual scrolling element. I fear setting it to 'pages' would effectively remove the lazy loading of the list, since it would think that there's nothing to scroll.
Reply all
Reply to author
Forward
0 new messages