From 3eed46904a3b1c6e3297b6b45d52d8c2479e3894 Mon Sep 17 00:00:00 2001 From: Shivangi Shree Date: Thu, 16 Jul 2026 12:11:29 +0530 Subject: [PATCH] [ACS-8468] Add guard to copyToClipboard --- .../card-view-dateitem.component.html | 7 +++++-- .../card-view-selectitem.component.ts | 16 +++++++++------- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.html b/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.html index d7ce78f8e1..e2e2952c5e 100644 --- a/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.html +++ b/lib/core/src/lib/card-view/components/card-view-dateitem/card-view-dateitem.component.html @@ -30,7 +30,6 @@ class="adf-datepicker-span-button" [attr.data-automation-id]="'datepicker-label-toggle-' + property.key" (click)="showDatePicker()" - (dblclick)="copyToClipboard(property.displayValue)" tabindex="0" role="button" (keyup.enter)="showDatePicker()" @@ -93,7 +92,10 @@ } } @else { - + ) { - if (isObservable(valueToCopy)) { - valueToCopy.pipe(take(1)).subscribe((value) => { + if (this.copyToClipboardAction) { + if (isObservable(valueToCopy)) { + valueToCopy.pipe(take(1)).subscribe((value) => { + const clipboardMessage = this.translateService.instant('CORE.METADATA.ACCESSIBILITY.COPY_TO_CLIPBOARD_MESSAGE'); + this.clipboardService.copyContentToClipboard(value, clipboardMessage); + }); + } else if (typeof valueToCopy === 'string') { const clipboardMessage = this.translateService.instant('CORE.METADATA.ACCESSIBILITY.COPY_TO_CLIPBOARD_MESSAGE'); - this.clipboardService.copyContentToClipboard(value, clipboardMessage); - }); - } else if (typeof valueToCopy === 'string') { - const clipboardMessage = this.translateService.instant('CORE.METADATA.ACCESSIBILITY.COPY_TO_CLIPBOARD_MESSAGE'); - this.clipboardService.copyContentToClipboard(valueToCopy, clipboardMessage); + this.clipboardService.copyContentToClipboard(valueToCopy, clipboardMessage); + } } }