diff --git a/lib/core/comments/comments.component.html b/lib/core/comments/comments.component.html index 9797a9df53..0188bf6f23 100644 --- a/lib/core/comments/comments.component.html +++ b/lib/core/comments/comments.component.html @@ -4,7 +4,7 @@
- +
diff --git a/lib/core/comments/comments.component.spec.ts b/lib/core/comments/comments.component.spec.ts index 677e3a2e6b..657d4cb65a 100644 --- a/lib/core/comments/comments.component.spec.ts +++ b/lib/core/comments/comments.component.spec.ts @@ -277,7 +277,7 @@ describe('CommentsComponent', () => { })); it('should clear comment when escape key is pressed', async(() => { - const event = new KeyboardEvent('keyup', {'key': 'Escape'}); + const event = new KeyboardEvent('keydown', {'key': 'Escape'}); let element = fixture.nativeElement.querySelector('#comment-input'); element.dispatchEvent(event); fixture.detectChanges(); @@ -365,7 +365,7 @@ describe('CommentsComponent', () => { })); it('should clear comment when escape key is pressed', async(() => { - const event = new KeyboardEvent('keyup', {'key': 'Escape'}); + const event = new KeyboardEvent('keydown', {'key': 'Escape'}); let element = fixture.nativeElement.querySelector('#comment-input'); element.dispatchEvent(event); fixture.detectChanges(); diff --git a/lib/core/comments/comments.component.ts b/lib/core/comments/comments.component.ts index d7fbfa424e..1a2ed3e4b2 100644 --- a/lib/core/comments/comments.component.ts +++ b/lib/core/comments/comments.component.ts @@ -165,7 +165,8 @@ export class CommentsComponent implements OnChanges { } } - clear(): void { + clear(event: KeyboardEvent): void { + event.stopPropagation(); this.message = ''; }