[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
1 changed files with 5 additions and 3 deletions

View File

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