Skip to content

Commit

Permalink
EZP-30765: Removing classes and attributes from blocks during unmount…
Browse files Browse the repository at this point in the history
…ing (#229)
  • Loading branch information
barw4 authored Sep 28, 2022
1 parent c6345c6 commit 051b95e
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,19 @@ export default class EzBtnAttributesEdit extends EzWidgetButton {
}

componentWillUnmount() {
this.block = null;

const block = this.findSelectedBlock();

this.beforeCommandExecHandler.removeListener();
this.afterCommandExecHandler.removeListener();

if (!block.$.getAttribute('data-ez-node-initialized')) {
this.removeClasses(block);
this.removeAttributes(block);

block.$.setAttribute('data-ez-node-initialized', true);
}
}

removeClasses(block) {
Expand Down

0 comments on commit 051b95e

Please sign in to comment.