You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 13, 2018. It is now read-only.
Due to iron-collapse also generating the same event, it bubbles up to the paper-submenu and triggers twice, and I am guessing due to event retargetting the target is set to paper-submenu each time...
We have to evaluate the event.path property to make sure we only listen to the actual submenu event. Below is the handler we use for on-opened-changed:
/**
* An observer that intercepts submenu open events and forces a subsequent
* iron-collapse updateSize call to bypass a race condition in iron-collapse.
* @param {!Object} evt The opened-changed event object.
* @param {!Object} change The change record for the opened property.
*/
ensureMenuOpens_: function(evt, change) {
if (change.value) {
var menu = evt.target;
// event from iron-collapse will bubble up and trigger this twice, so if
// path[0].tagName is not paper-submenu, we ignore this.
if (evt.path[0].tagName.toLowerCase() == 'paper-submenu') {
menu.async(function() {
this.set('opened', true);
this.$.collapse.updateSize('auto', true);
}, 1);
}
}
},
Note: Our need for this handler could be a side-effect of #88, after reading it, but I am not positive.