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:
parent
17ab522942
commit
679b170bc5
4 changed files with 63 additions and 5 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue