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

fixes #81, #104 #105

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

morficus
Copy link

adding new attrForSelected attribute to specify an attribute whose value to use as this elements value

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed, please reply here (e.g. I signed it!) and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please let us know the company's name.

@googlebot
Copy link

CLAs look good, thanks!

} else {
value = selectedItem.label || selectedItem.textContent.trim();
label = selectedItem.label || selectedItem.textContent.trim();
value = selectedItem[this.attrForSelected] || label;

Choose a reason for hiding this comment

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

@morficus
Would you consider the following: value = selectedItem[this.contentElement.attrForSelected] || label; ?

The reason being that attr-for-selected stays on the paper-menu/paper-listbox contained in the content section. This is useful since paper-dropdown-menu doesn't have any way of setting the selected item. Selection must be done on the paper-listbox, which means that one may have to duplicate the attr-for-selected on the paper-listbox.

It would enable the following:
eg.)

let _bar = 0;
....
<paper-dropdown-menu>
  <paper-listbox selected="{{_bar}}" attr-for-selected="foo" class="dropdown-content">
    <paper-item foo="0">Zero</paper-item>
    <paper-item foo="10">Ten</paper-item>
    <paper-item foo="20">Twenty</paper-item>
  </paper-listbox>
</paper-dropdown-menu>

Copy link
Author

Choose a reason for hiding this comment

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

This is useful since paper-dropdown-menu doesn't have any way of setting the selected item. Selection must be done on the paper-listbox

Very good point about the selection staing with in the list-element it self 👍 I'll make the change and update the PR

adding new `attrForSelected` attribute to specify an attribute whose value to use as this elements `value`
@zmoshansky
Copy link

@cdata Could you please review?

@cdata
Copy link
Contributor

cdata commented Feb 18, 2016

I have left some feedback on this design on #104

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

Successfully merging this pull request may close these issues.

4 participants