Skip to content Skip to sidebar Skip to footer

Why Doesn't Element Catch Event When Using Dispatchevent From Sibling Polymer Element?

I have the following polymer element in my UI which has two polymer elements, baseline-policy-create and baseline-policy-domain-ajax.

Solution 1:

as Mishu said in comment, events travel up in the hierarchy. So in your baseline-policies-tab you need to catch that event and pass it to baseline-policy-domain-ajax manually.

Some example:

<dom-module id="baseline-policies-tab">
<template><styleinclude="dfw-styles">:host {
    display: block;
  }
</style><baseline-policy-createon-domain-ajax="_onDomainAjax"></baseline-policy-create><baseline-policy-domain-ajax></baseline-policy-domain-ajax></template><script>classBaselinePoliciesTabextendsPolymer.Element {
  staticgetis() {
    return'baseline-policies-tab';
  }

  staticgetproperties() {
  }

  _onDomainAjax(e) {
    this.shadowRoot.querySelector("baseline-policy-domain-ajax")._editPage(e);
  }
}
customElements.define(BaselinePoliciesTab.is, BaselinePoliciesTab);

</script>
</dom-module>

Post a Comment for "Why Doesn't Element Catch Event When Using Dispatchevent From Sibling Polymer Element?"