mirror of
https://github.com/bitwarden/browser.git
synced 2024-10-06 05:28:51 +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:
parent
ac1c7f9c8f
commit
1d7360bfdd
@ -561,7 +561,6 @@ h2,
|
|||||||
h3,
|
h3,
|
||||||
label,
|
label,
|
||||||
a,
|
a,
|
||||||
button,
|
|
||||||
p,
|
p,
|
||||||
img,
|
img,
|
||||||
.box-header,
|
.box-header,
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { Directive, ElementRef, HostListener, Input } from "@angular/core";
|
import { Directive, ElementRef, HostListener, Input } from "@angular/core";
|
||||||
|
|
||||||
|
import { ClientType } from "@bitwarden/common/enums";
|
||||||
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
import { PlatformUtilsService } from "@bitwarden/common/platform/abstractions/platform-utils.service";
|
||||||
|
|
||||||
@Directive({
|
@Directive({
|
||||||
@ -15,6 +16,9 @@ export class CopyTextDirective {
|
|||||||
return;
|
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…
Reference in New Issue
Block a user