PolymerElements / iron-pages

Simple content switcher
https://www.webcomponents.org/element/PolymerElements/iron-pages
48 stars 19 forks source link

Allow restamping #53

Open nicholaswmin opened 7 years ago

nicholaswmin commented 7 years ago

As it is right now, iron-pages doesn't provide for a way to destroy non-currently viewed pages and restamp them when they come back into view.

Providing a property that does this (perhaps restamp), would allow for significant performance improvements when navigating through complex DOM chunks with multiple levels of nested iron-pages.

There's potential hacks around this using <dom-if> but they don't really scale well for many subpages and they result in convoluted markup, see this S.O question

Boscop commented 7 years ago

+1 for this! Btw, I found this related blog post: http://nader.tn/2015/07/polymer-element-recreation/

JunedS commented 7 years ago

+1 Missing this feature very much. Btw, I found this https://github.com/TimvdLippe/iron-lazy-pages built on top of iron-pages Why cant the same be implemented in iron-pages?

TimvdLippe commented 7 years ago

I have just pushed support for dom-if in iron-lazy-pages. The implementation is rather naive: just mimic the if property to the selected/deselected to trigger the dom-if restamping. Check it out at https://github.com/TimvdLippe/iron-lazy-pages/pull/56

tandacedric commented 6 years ago

Do like this image Do not forget to put the "div" because iron-page needs that to manage and create equal fonction in your script like this image