Determining visibility of a Polymer Element in a single page app

559 views
Skip to first unread message

black...@gmail.com

unread,
Nov 3, 2014, 12:53:21 PM11/3/14
to polym...@googlegroups.com
Is there a way to determine the visibility of a Polymer element in a single page app?
My use case is using core-pages with nested elements representing different sections of my app in a single page app and I need to determine if a Polymer element is visible to the user.

Eric Bidelman

unread,
Nov 3, 2014, 1:27:33 PM11/3/14
to black...@gmail.com, polymer-dev
By default, core-pages applies an `active` attribute and a class="core-selected" to the selected page.

On Mon, Nov 3, 2014 at 9:53 AM, <black...@gmail.com> wrote:
Is there a way to determine the visibility of a Polymer element in a single page app?
My use case is using core-pages with nested elements representing different sections of my app in a single page app and I need to determine if a Polymer element is visible to the user.

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/d2a9bd20-d78d-4cfc-b190-c11dd0964649%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

black...@gmail.com

unread,
Nov 3, 2014, 2:48:44 PM11/3/14
to polym...@googlegroups.com, black...@gmail.com
Thanks for the quick response! 
I should have been more specific.   I'm seeing the issue with nesting of core-pages.  
As a use case, take the excellent Single Page App demo for example and put some paper-tabs around it so that you have a core-scaffold in each tab.  As one changes from tab to tab, the core-selected and active attributes follow the parent level but the state of an element on each nested core-scaffold does not change.... only the parent (core-tab).  Whichever element was selected on the nested element remains selected (core-selected and active) even though it's no longer in view.  A keystroke bound on an element that is not visible, will still work as its nested state is still selected and active. 

black...@gmail.com

unread,
Nov 7, 2014, 11:57:17 AM11/7/14
to polym...@googlegroups.com, black...@gmail.com
I had the keypress bound to "document" rather than "this" which seems to have resolved the <pressing> issue.  Pun intended.
Reply all
Reply to author
Forward
0 new messages