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

dom-repeat isn't supplying expected variables #3797

Closed
admwx7 opened this issue Jul 22, 2016 · 1 comment
Closed

dom-repeat isn't supplying expected variables #3797

admwx7 opened this issue Jul 22, 2016 · 1 comment

Comments

@admwx7
Copy link

admwx7 commented Jul 22, 2016

Description

When using a filter on dom-repeat only one parameter is being passed to the filter function when it's called, the current item in the array, this is a bit of a hindrance when performing filtering on arrays since index and the original array are often used in the filtering process and are supplied when dealing with filtering, it is expected that dom-repeat would match the JS spec for array.filter that provides all three.

Live Demo

https://jsfiddle.net/amurdock/rumt2by9/

Steps to Reproduce

  1. Create a dom-repeat instance on an array
  2. Attempt to filter the dom-repeat based on either the index or the original array value, these are typical parameters as you would expect when dealing with filtering an array
    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/filter

Expected Results

The filter gets called with (element, item, array)

Actual Results

The filter function is getting called with only the element parameter

Browsers Affected

  • [x ] Chrome
  • [x ] Firefox
  • [x ] Edge
  • [x ] Safari 9
  • [x ] Safari 8
  • [x ] IE 11

Versions

  • Polymer: v1.6.0
  • webcomponents: v0.7.22
@admwx7
Copy link
Author

admwx7 commented Jul 22, 2016

Obsoleted due to #3094 #3798

@admwx7 admwx7 closed this as completed Jul 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant