Fix block tunes being unable to open after tune activation

This commit is contained in:
Tanya Fomina 2022-11-03 19:04:09 +02:00
parent d7ebf5983a
commit 89601e19e9
2 changed files with 9 additions and 0 deletions

View file

@ -121,6 +121,7 @@ export default class BlockSettings extends Module<BlockSettingsNodes> {
scopeElement: this.Editor.API.methods.ui.nodes.redactor,
});
this.popover.on(PopoverEvent.OverlayClicked, this.onOverlayClicked);
this.popover.on(PopoverEvent.Close, () => this.close());
this.nodes.wrapper.append(this.popover.getElement());
@ -167,6 +168,7 @@ export default class BlockSettings extends Module<BlockSettingsNodes> {
this.popover.off(PopoverEvent.OverlayClicked, this.onOverlayClicked);
this.popover.destroy();
this.popover.getElement().remove();
this.popover = null;
}
}

View file

@ -15,6 +15,11 @@ export enum PopoverEvent {
* When popover overlay is clicked
*/
OverlayClicked = 'overlay-clicked',
/**
* When popover closes
*/
Close = 'close'
}
/**
@ -272,6 +277,8 @@ export default class Popover extends EventsDispatcher<PopoverEvent> {
confirmationStateItems.forEach((itemEl: HTMLElement) => this.cleanUpConfirmationStateForItem(itemEl));
this.disableSpecialHoverAndFocusBehavior();
this.emit(PopoverEvent.Close);
}
/**