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

Duplicate Numbers Cause Incorrect Selection Behavior #367

Closed
3 of 8 tasks
rajsite opened this issue Dec 22, 2016 · 3 comments
Closed
3 of 8 tasks

Duplicate Numbers Cause Incorrect Selection Behavior #367

rajsite opened this issue Dec 22, 2016 · 3 comments

Comments

@rajsite
Copy link

rajsite commented Dec 22, 2016

Description

When using an array of numbers as the items for iron-list, having duplicate values in the array causes the selection behavior to select the wrong item.

Expected outcome

The item at the index clicked is selected

Actual outcome

A different item with the same value, but at an index that was not clicked is selected

Live Demo

http://jsbin.com/jusenih/1/edit?html,output

Steps to reproduce

  1. Open the jsbin and select (ie click) Item 3
  1. Notice that it is Item 7 that has selected changed to true

Browsers Affected

  • Firefox
  • Safari 9
  • Chrome
  • Safari 8
  • Safari 7
  • Edge
  • IE 11
  • IE 10
    ^ Browsers reproducing the behavior
    ^ Firefox Nightly reproduces intermittently
@blasten
Copy link
Contributor

blasten commented Dec 22, 2016

Yep, this is known issue. Check Polymer/polymer#1913 for more reference. Is it possible for you to wrap the values in an object?

There's an explanatory PR by @kevinpschaaf around this issue in Polymer/polymer#3970 (comment) for Polymer 2.0.

@rajsite
Copy link
Author

rajsite commented Dec 23, 2016

Ah I had missed that, thanks @blasten. I had noticed the behavior when playing with the jsbins referenced in the README when evaluating iron-list (which all demonstrate using an array of numbers).

I did not notice the same problem as my data set is an array of objects (although it did make me hesitant to use the iron-list element). I imagine the common use case in an array of objects instead of primitives. It might be useful to have the examples demonstrate that use case and / or have this limitation using arrays of primitives documented.

@rajsite
Copy link
Author

rajsite commented Jul 19, 2017

The original question of this issue was definitely a duplicate of Polymer/polymer#1913

The second question of whether the jsbin examples should not demonstrate arrays of numbers as that causes strange behavior seems moot as the jsbin examples are non-functional: #465

I'll just close this issue and a separate issue could be opened for the jsbin iron-list examples using numerics.

@rajsite rajsite marked this as a duplicate of Polymer/polymer#1913 Jul 19, 2017
@rajsite rajsite closed this as completed Jul 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants