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

items not updated when selectable is changed #126

Open
globits opened this issue Jun 22, 2016 · 5 comments
Open

items not updated when selectable is changed #126

globits opened this issue Jun 22, 2016 · 5 comments

Comments

@globits
Copy link

globits commented Jun 22, 2016

The items property is not updated when selectable property changes

Expected outcome

items and selectedItem properties are updated when selectable change.

Actual outcome

items array and selectedItem are not updated when selectable change.

Steps to reproduce

  1. Set up selectable property.
  2. Check items array length.
  3. Change selectable property.
  4. Check items array length.

Test Case

http://jsbin.com/qacariqucu/edit?html,js,output

@bicknellr
Copy link
Contributor

The test case you provided seems to work. Are you seeing different values for numItems and expectedItems? (Maybe I don't understand the issue?)

@MarcMouallem
Copy link

MarcMouallem commented Dec 7, 2016

I solved this issue myself by adding '_updateItems(selectable)' to the observers array in iron-selectable. An official fix would be nice, please! Just a note, this issue only occurs when the value for selectable is changed after iron-selectable is attached.

The issue is that _updateItems() is only called upon attachment and adding and removing items, and is not called again when the value of selectable is changed.

If you want me to create a pull request I can, but it's just a one line fix; refer to first line of comment.

@MarcMouallem
Copy link

MarcMouallem commented Dec 13, 2016

@bicknellr Any update on wether the Polymer team is going to fix this issue? Also, looks like my previous suggestion is incomplete as you would also have to _updateSelected() if you should.

@globits
Copy link
Author

globits commented Feb 15, 2017

Thats exactly the problem, there`s a PR already on #127 , fell free to update it if necessary.

globits added a commit to globits/iron-selector that referenced this issue Mar 13, 2017
@globits
Copy link
Author

globits commented Mar 13, 2017

Please, check an updated PR regarding this issue on #149

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

Successfully merging a pull request may close this issue.

3 participants