Skip to content

Commit b042dc8

Browse files
committed
Merge branch 'next' of https://github.com/carbon-design-system/carbon-components-angular into component-factory-resolver
2 parents 252c75c + 2d72137 commit b042dc8

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/modal/base-modal.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export class BaseModalService {
4848
component.instance.open = false;
4949
}),
5050
// delay closing by an arbitrary amount to allow the animation to finish
51-
delay(150)
51+
delay(240)
5252
).subscribe(() => {
5353
this.placeholderService.destroyComponent(component);
5454
// filter out our component
@@ -81,7 +81,7 @@ export class BaseModalService {
8181
// Let animation finish before component is removed
8282
setTimeout(() => {
8383
this.placeholderService.destroyComponent(BaseModalService.modalList[index]);
84-
}, 300);
85-
BaseModalService.modalList.splice(index, 1);
84+
BaseModalService.modalList.splice(index, 1);
85+
}, 240);
8686
}
8787
}

src/modal/modal.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,10 @@ export class Modal implements AfterViewInit, OnChanges, OnDestroy {
196196
switch (event.key) {
197197
case "Escape": {
198198
event.stopImmediatePropagation(); // prevents events being fired for multiple modals if more than 2 open
199-
this.modalService.destroy(); // destroy top (latest) modal
199+
// Manually close modal
200+
this.open = false;
200201
this.close.emit();
202+
this.modalService.destroy(); // destroy top (latest) modal
201203
break;
202204
}
203205

0 commit comments

Comments
 (0)