Set composed: true on all bubbled events

In Polymer 2, and when using native shadow DOM, events that do not have
`composed: true` set do not cross shadow DOM boundaries. I cross checked
and all these events seem to be handled outside of the component that
fires them, so they need this.

Change-Id: Iee8d2d545f3b1ea0bfb624648637fd190b952feb
This commit is contained in:
Ole Rehmsen
2019-05-16 14:43:01 +02:00
parent 8189f32d58
commit c82baba734
37 changed files with 192 additions and 102 deletions

View File

@@ -137,17 +137,19 @@
_handleValueChange() {
this.permission.value.modified = true;
// Allows overall access page to know a change has been made.
this.dispatchEvent(new CustomEvent('access-modified', {bubbles: true}));
this.dispatchEvent(
new CustomEvent('access-modified', {bubbles: true, composed: true}));
},
_handleRemovePermission() {
if (this.permission.value.added) {
this.dispatchEvent(new CustomEvent('added-permission-removed',
{bubbles: true}));
this.dispatchEvent(new CustomEvent(
'added-permission-removed', {bubbles: true, composed: true}));
}
this._deleted = true;
this.permission.value.deleted = true;
this.dispatchEvent(new CustomEvent('access-modified', {bubbles: true}));
this.dispatchEvent(
new CustomEvent('access-modified', {bubbles: true, composed: true}));
},
_handleRulesChanged(changeRecord) {
@@ -273,7 +275,8 @@
const value = this._rules[this._rules.length - 1].value;
value.added = true;
this.set(['permission', 'value', 'rules', groupId], value);
this.dispatchEvent(new CustomEvent('access-modified', {bubbles: true}));
this.dispatchEvent(
new CustomEvent('access-modified', {bubbles: true, composed: true}));
},
_computeHasRange(name) {