0
votes

I am using a paper-dropdown-menu and at present have an on-iron-select in the paper-dropdown-menu. I need a way to have this only fire when the user makes a selection and not when the selected item in the embeded paper-listbox changes. Is this possible or is there a way to distinguish the event?

The paper-dropdown-menu is dynamically created so i cannot bind a static variable to it and use an observer on that.

Any help would be appreciated.

Thanks

2

2 Answers

1
votes

Well I have bad news for you. You canĀ“t know if this event was trigged by User or Polymer. The event you recive is the same for both cases. But there might be a solution. If you have a paper-listbox as child of the dropdown, you can use its selected property to see whats selected. So now add a simple observer on the property which is bound to the selected attribute. This observer gets always the old and new val so if the old val was undefined you know this was trigged by polymer. I know not a nice solution but yeah this is just how polymer works

_selectedChanged: function(newVal, oldVal){
     if(oldVal !== undefined) {
         //do something
     }
}
0
votes

I have added an on-tap listener to the paper-item as a work around and that seems to do the trick in my case.