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

Update items when selectable property changes, test provided, issue #126 #149

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

globits
Copy link

@globits globits commented Mar 13, 2017

New PR for obsolete PR #127

@ronnyroeller
Copy link
Contributor

+1

Copy link
Contributor

@bicknellr bicknellr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for sending this PR. It needs a rebase now that 2.x is out and I left a couple comments but this seems like the right way to fix this issue. 👍

selectable: String,
selectable: {
type: String,
observer: '_selectableChanged'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This behavior seems to have all of its observers down in the observers array. I think it might be better to put this one there too.

@@ -268,6 +271,13 @@
this._addListener(eventName);
},

_selectableChanged: function() {
this._updateItems();
if (this._shouldUpdateSelection) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As of 2.x you don't need to check _shouldUpdateSelection.

@@ -167,19 +167,22 @@
});

test('`selectIndex()` selects an item with the given index', function() {
assert.equal(s2.selectedItem, undefined);
Polymer.Base.async(function() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests now wait for iron-items-changed, so I think after rebasing you'll find this async delay isn't necessary.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants