1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-07-02 11:34:53 +02:00

[PS-1438] Prevent new line feed when selecting and copying passwords (#3460)

* Prevent new line feed when selecting password

* Prevent new line feed when copying password
This commit is contained in:
Dave Nicolson 2023-09-01 12:06:49 +02:00 committed by GitHub
parent ac1c7f9c8f
commit 1d7360bfdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 2 deletions

View File

@ -561,7 +561,6 @@ h2,
h3,
label,
a,
button,
p,
img,
.box-header,

View File

@ -1,5 +1,6 @@
import { Directive, ElementRef, HostListener, Input } from "@angular/core";
import { ClientType } from "@bitwarden/common/enums";
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
@Directive({
@ -15,6 +16,9 @@ export class CopyTextDirective {
return;
}
this.platformUtilsService.copyToClipboard(this.copyText, { window: window });
const timeout = this.platformUtilsService.getClientType() === ClientType.Desktop ? 100 : 0;
setTimeout(() => {
this.platformUtilsService.copyToClipboard(this.copyText, { window: window });
}, timeout);
}
}