diff --git a/lib/core/src/lib/clipboard/clipboard.directive.spec.ts b/lib/core/src/lib/clipboard/clipboard.directive.spec.ts index d19d6951cc..17f84ee1a3 100644 --- a/lib/core/src/lib/clipboard/clipboard.directive.spec.ts +++ b/lib/core/src/lib/clipboard/clipboard.directive.spec.ts @@ -64,14 +64,6 @@ describe('ClipboardDirective', () => { expect(clipboardService.copyToClipboard).toHaveBeenCalled(); }); - - it('should notify copy target value on mouse enter event', () => { - spyOn(clipboardService, 'copyToClipboard'); - fixture.nativeElement.querySelector('input').value = 'some value'; - window.dispatchEvent(new KeyboardEvent('keydown', {code: 'Enter', key: 'Enter'})); - - expect(clipboardService.copyToClipboard).toHaveBeenCalled(); - }); }); describe('CopyClipboardDirective', () => { @@ -136,15 +128,6 @@ describe('CopyClipboardDirective', () => { expect(navigator.clipboard.writeText).toHaveBeenCalledWith('text to copy'); })); - it('should copy the content of element on mouse enter', fakeAsync(() => { - fixture.detectChanges(); - spyOn(navigator.clipboard, 'writeText'); - window.dispatchEvent(new KeyboardEvent('keydown', {code: 'Enter', key: 'Enter'})); - tick(); - fixture.detectChanges(); - expect(navigator.clipboard.writeText).toHaveBeenCalledWith('text to copy'); - })); - it('should not copy the content of element when click it', fakeAsync(() => { const spanHTMLElement = element.querySelector('span'); fixture.detectChanges(); diff --git a/lib/core/src/lib/clipboard/clipboard.directive.ts b/lib/core/src/lib/clipboard/clipboard.directive.ts index 95c0c5da26..ee898cfb4b 100644 --- a/lib/core/src/lib/clipboard/clipboard.directive.ts +++ b/lib/core/src/lib/clipboard/clipboard.directive.ts @@ -46,12 +46,6 @@ export class ClipboardDirective { event.stopPropagation(); this.copyToClipboard(); } - @HostListener('window:keydown.enter', ['$event']) - handleKeyDown(event: KeyboardEvent){ - event.preventDefault(); - event.stopPropagation(); - this.copyToClipboard(); - } @HostListener('mouseenter') showTooltip() {