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

Implements attr-for-selected, selected-attr, and selected-item #66

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

Conversation

bennypowers
Copy link

Does what it says on the box.
also fixes a typo

* @param {Event} event Polymer change event
*/
onSelectedItemChanged(event) {
this._setSelectedItem(event.detail.value);
Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @bennypowers

What is this for?

_setSelectedItem is being set on _selectedObserver already.

Copy link
Author

@bennypowers bennypowers Mar 8, 2018

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)

Copy link
Contributor

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.

Copy link
Author

@bennypowers bennypowers Mar 8, 2018

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

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 this pull request may close these issues.

2 participants