Close the release announcement when a dialog is opened (#12559)
* Fire `ModalManagerEvent.Closed` when a dialog is closed * Listen to modal events in the RA * Fix first RA test
This commit is contained in:
@@ -65,10 +65,12 @@ interface IOptions<C extends ComponentType> {
|
||||
|
||||
export enum ModalManagerEvent {
|
||||
Opened = "opened",
|
||||
Closed = "closed",
|
||||
}
|
||||
|
||||
type HandlerMap = {
|
||||
[ModalManagerEvent.Opened]: () => void;
|
||||
[ModalManagerEvent.Closed]: () => void;
|
||||
};
|
||||
|
||||
export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMap> {
|
||||
@@ -232,6 +234,7 @@ export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMa
|
||||
}
|
||||
|
||||
this.reRender();
|
||||
this.emitClosed();
|
||||
},
|
||||
deferred.promise,
|
||||
];
|
||||
@@ -328,6 +331,14 @@ export class ModalManager extends TypedEventEmitter<ModalManagerEvent, HandlerMa
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Emit the closed event
|
||||
* @private
|
||||
*/
|
||||
private emitClosed(): void {
|
||||
this.emit(ModalManagerEvent.Closed);
|
||||
}
|
||||
|
||||
private onBackgroundClick = (): void => {
|
||||
const modal = this.getCurrentModal();
|
||||
if (!modal) {
|
||||
|
||||
Reference in New Issue
Block a user