-
Notifications
You must be signed in to change notification settings - Fork 10
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
Implements attr-for-selected, selected-attr, and selected-item #66
base: master
Are you sure you want to change the base?
Conversation
* @param {Event} event Polymer change event | ||
*/ | ||
onSelectedItemChanged(event) { | ||
this._setSelectedItem(event.detail.value); |
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.
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.
I think it's better to set it based off the iron-selector's selectedItem
prop, than to create our own with bracket syntax.
In general I prefer smaller single-purpose methods, rather than do-it-all observers. I'll make a commit which removes the call to _setSelectedItem
in _selectedObserver
, or if you like I can remove the listener and change the call in _selectedObserver
to _setSelectedItem(this.$.selector.selectedItem)
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.
I can remove the listener and change the call in _selectedObserver to _setSelectedItem(this.$.selector.selectedItem)
That sounds reasonable, but I was trying to use attr-for-selected
and it didn't work, many pieces of this component depend on numerical index values right now, so a lot of work is required.
If you want to give it a shot I think the first step is to replace _children
and all its related logic with iron-selector
's items
.
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.
I think the way forward is to use Polymer.IronSelectableBehavior instead of instantiating <iron-selector>
in the template. I'll get working on it in this PR
Does what it says on the box.
also fixes a typo