mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-4051] Copy to clipboard button is now accessible through the keyboard enter earlier which was only accessible through mouse click (#8165)
* Copy to clipboard button is now accessible through the keyboard enter earlier which was only accessible through mouse click * review comments addressed
This commit is contained in:
@@ -40,13 +40,6 @@ export class ClipboardDirective {
|
||||
public viewContainerRef: ViewContainerRef,
|
||||
private resolver: ComponentFactoryResolver) {}
|
||||
|
||||
@HostListener('click', ['$event'])
|
||||
handleClickEvent(event: MouseEvent) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
this.copyToClipboard();
|
||||
}
|
||||
|
||||
@HostListener('mouseenter')
|
||||
showTooltip() {
|
||||
if (this.placeholder) {
|
||||
@@ -61,7 +54,12 @@ export class ClipboardDirective {
|
||||
this.viewContainerRef.remove();
|
||||
}
|
||||
|
||||
private copyToClipboard() {
|
||||
@HostListener('click', ['$event'])
|
||||
@HostListener('keydown.enter', ['$event'])
|
||||
copyToClipboard(event: MouseEvent | KeyboardEvent) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
||||
const isValidTarget = this.clipboardService.isTargetValid(this.target);
|
||||
|
||||
if (isValidTarget) {
|
||||
|
Reference in New Issue
Block a user