Skip to content

dom-repeat filter/sort needs to be able to observe parent scope #1572

Closed
@mbleigh

Description

Right now, the dom-repeat filter and sort only refire on array mutations or item subproperty changes with the observe attribute. However this ignores a very common use case for filtering and sorting: user-driven changes to filter. Imagine for instance a simple list of items with a "text search" filter:

<template is="dom-repeat" filter="search">
  <span>[[item.name]]</span>
</template>

<script>
Polymer({
  search: function(item) {
    return item.name.toLowerCase().indexOf(this.q.toLowerCase()) >= 0;
  }
});
</script>

In this scenario, there is no way to make the template re-stamp when an external parameter changes (e.g. q in the example).

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions