paper-dropdown-menu
paper-dropdown-menu copied to clipboard
Observer set for `value` attribute gets fired twice each time an item gets picked
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!
<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);
}
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?