Browse Source

[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
pull/6173/head
Dave Nicolson 2 years ago committed by GitHub
parent
commit
1d7360bfdd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      apps/desktop/src/scss/misc.scss
  2. 6
      libs/angular/src/directives/copy-text.directive.ts

1
apps/desktop/src/scss/misc.scss

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

6
libs/angular/src/directives/copy-text.directive.ts

@ -1,5 +1,6 @@ @@ -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 { @@ -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);
}
}

Loading…
Cancel
Save