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

Observer set for value attribute gets fired twice each time an item gets picked #252

Open
vedtam opened this issue Jun 25, 2017 · 1 comment

Comments

@vedtam
Copy link

vedtam commented Jun 25, 2017

Hi,

Each time I pick an item from the paper-dropdown-menu, the observer which I set for the value attribute gets fired twice, once having the desired value and a second time having null.

Expected outcome

The observer should fire only once / item picked.

Thanks!

screen shot 2017-06-25 at 08 59 29

<paper-dropdown-menu label="pick a category" value="{{category}}" id="categories" style="display: inline;">
  <paper-listbox slot="dropdown-content" class="dropdown-content" selected="{{selectedCategory}}">
    <template is="dom-repeat" items="{{noneEmptyCategs}}">
        <paper-item value={{item.category}}>{{item.category}}</paper-item>
    </template>
  </paper-listbox>
</paper-dropdown-menu>

....

static get properties(){
  return {
    category: {
      type: String,
      observer: 'categorySelected',
      value: ''
    }
  }
}


categorySelected(category){
  console.log('item picked: ' + category);
}
@hobbyquaker
Copy link

hobbyquaker commented Aug 7, 2017

https://github.com/PolymerElements/paper-dropdown-menu/blob/master/paper-dropdown-menu.html#L354 - I'm asking myself if handling the iron-deselect event is neccessary at all because one can't deselect something in a dropdown?

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

No branches or pull requests

2 participants