1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-11-29 12:55:21 +01:00

[AC-1084] Don't copy hidden spaces when selecting password (#4848)

* Don't copy hidden spaces when selecting password

Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>

* [AC-1084] fix: remove whitespaces from inline component

---------

Co-authored-by: Andreas Coroiu <acoroiu@bitwarden.com>
Co-authored-by: Andreas Coroiu <andreas.coroiu@gmail.com>
This commit is contained in:
Thomas Rittson 2023-03-03 17:15:23 +10:00 committed by GitHub
parent c7a71dc22e
commit 04d1fbb716
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,7 @@ enum CharacterType {
@Component({ @Component({
selector: "bit-color-password", selector: "bit-color-password",
template: `<div template: `<span
*ngFor="let character of passwordArray; index as i" *ngFor="let character of passwordArray; index as i"
[class]="getCharacterClass(character)" [class]="getCharacterClass(character)"
> >
@ -19,7 +19,8 @@ enum CharacterType {
<span *ngIf="showCount" class="tw-whitespace-nowrap tw-text-xs tw-leading-5 tw-text-main">{{ <span *ngIf="showCount" class="tw-whitespace-nowrap tw-text-xs tw-leading-5 tw-text-main">{{
i + 1 i + 1
}}</span> }}</span>
</div>`, </span>`,
preserveWhitespaces: false,
}) })
export class ColorPasswordComponent { export class ColorPasswordComponent {
@Input() private password: string = null; @Input() private password: string = null;
@ -44,10 +45,11 @@ export class ColorPasswordComponent {
getCharacterClass(character: string) { getCharacterClass(character: string) {
const charType = this.getCharacterType(character); const charType = this.getCharacterType(character);
const charClass = this.characterStyles[charType].concat("tw-inline-flex"); const charClass = this.characterStyles[charType];
if (this.showCount) { if (this.showCount) {
return charClass.concat([ return charClass.concat([
"tw-inline-flex",
"tw-flex-col", "tw-flex-col",
"tw-items-center", "tw-items-center",
"tw-w-7", "tw-w-7",