-
Notifications
You must be signed in to change notification settings - Fork 55
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
base: master
Are you sure you want to change the base?
Conversation
+1 |
There was a problem hiding this 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' |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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.
New PR for obsolete PR #127