Skip to content
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

list doesn't reflect changes to array/object properties from the parent scope. #109

Closed
blasten opened this issue Sep 28, 2015 · 5 comments
Closed
Assignees
Labels

Comments

@blasten
Copy link
Contributor

blasten commented Sep 28, 2015

Iron-list: http://jsbin.com/subuqi/1/edit?html,output

It works fine if you replace the iron-list with a dom-repeat http://jsbin.com/bejivu/edit?html,output

@kevinpschaaf
Copy link
Contributor

Root caused to https://github.com/Polymer/polymer/blob/master/src/lib/template/templatizer.html#L243 not adding notifyPath API, or any related path handling capability to the template.

@kevinpschaaf
Copy link
Contributor

Blocked on core issue Polymer/polymer#2505.

The solution is non-trivial, and may cause us to rethink the templatizer design that allows the templatizer client (element that has the Polymer.Templatizer behavior, iron-list in this case) to be separate from the templatized template (in this case, the light-dom template passed to iron-list).

We may need to consider a breaking change to iron-list that would move to making the <template> itself a custom element, rather than passing a template to the custom element.

That is, moving from:

<iron-list items="{{items}}">
  <template>...</template>
</iron-list>

to:

<div style="overflow:auto;">
  <template is="iron-list" items="{{items}}">...</template>
</div>

We could supply a scroller/list container that provides the scrolling styling and possibly other value-added features, aka:

<iron-scroller>
  <template is="iron-list" items="{{items}}">...</template>
<iron-scroller>

This needs to be weighed against any long-term needs for the Templatizer to be separable from the templatized template(s), for supporting things like polymorphic templates.

@niflostancu
Copy link

I really like the idea of template instances being linked to both the parent element that defines it and the Templatizer client that uses it.

It brings new possibilities of customizability for Polymer elements.
For example, I'm currently working on a data table element that needs to be able to render rich cells for certain columns (e.g. action buttons / custom HTML code).
This can be accomplished by the user of the element providing templates for each column (which may need to have event listeners and data bindings on the parent/user element) and the table element will use them for stamping the cell contents.

@kevinpschaaf
Copy link
Contributor

For now, we went with a low-impact fix to just make it work, and preserves the ability to have Templatizer client and templatized template separate, as in the current iron-list implementation.

@blasten Polymer/polymer#2505 is now resolved; can you confirm in iron-list and close? Thanks.

@blasten
Copy link
Contributor Author

blasten commented Oct 9, 2015

@kevinpschaaf I can confirm that this bug has been fixed :)
http://jsbin.com/subuqi/1/edit?html,output /cc @sjmiles

@blasten blasten closed this as completed Oct 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants