Skip to content

Commit

Permalink
fix(cloud-image-editor): dispatch events with bubble and composed
Browse files Browse the repository at this point in the history
… flags
  • Loading branch information
nd0ut committed Feb 8, 2023
1 parent 1fff5fb commit 58733c4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion blocks/CloudImageEditor/src/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,21 @@ export function initState(fnCtx) {
fnCtx.dispatchEvent(
new CustomEvent('apply', {
detail: eventData,
bubbles: true,
composed: true,
})
);
fnCtx.remove();
},
'*on.cancel': () => {
fnCtx.remove();

fnCtx.dispatchEvent(new CustomEvent('cancel'));
fnCtx.dispatchEvent(
new CustomEvent('cancel', {
bubbles: true,
composed: true,
})
);
},
};
}

0 comments on commit 58733c4

Please sign in to comment.