Merge pull request #15995 from abpframework/bug/15990

abp-modal closing even keyboard:false solved
pull/15997/head
Mahmut Gundogdu 3 years ago committed by GitHub
commit 6f82b6bd21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -196,7 +196,7 @@ export class ModalComponent implements OnInit, OnDestroy, DismissableModal {
.pipe(
takeUntil(this.destroy$),
debounceTime(150),
filter((key: KeyboardEvent) => key && key.key === 'Escape'),
filter((key: KeyboardEvent) => key && key.key === 'Escape' && this.options.keyboard),
)
.subscribe(() => this.close());
}

@ -158,8 +158,9 @@ describe('ModalComponent', () => {
spectator.dispatchKeyboardEvent(spectator.component.modalWindowRef, 'keyup', 'Escape');
await wait300ms();
const { keyboard } = spectator.component.options;
expect(spectator.component.visible).toBe(false);
expect(spectator.component.visible).toBe(!keyboard);
});
it('should not close when busy is true', async () => {

Loading…
Cancel
Save