1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-11 05:53:42 +00:00

restore min/max html constraints to passphrases

This commit is contained in:
✨ Audrey ✨
2025-01-08 12:35:37 -05:00
parent d72dd2ea76
commit 9602d1057c
2 changed files with 11 additions and 0 deletions

View File

@@ -12,6 +12,8 @@
formControlName="numWords"
id="num-words"
type="number"
[min]="numWordsMin"
[max]="numWordsMax"
(change)="save('numWords')"
/>
<bit-hint>{{ numWordsBoundariesHint$ | async }}</bit-hint>

View File

@@ -114,6 +114,9 @@ export class PassphraseSettingsComponent implements OnInit, OnDestroy {
this.wordSeparatorMaxLength = constraints.wordSeparator.maxLength;
this.policyInEffect = constraints.policyInEffect;
this.numWordsMin = constraints.numWords.min;
this.numWordsMax = constraints.numWords.max;
this.toggleEnabled(Controls.capitalize, !constraints.capitalize?.readonly);
this.toggleEnabled(Controls.includeNumber, !constraints.includeNumber?.readonly);
});
@@ -128,6 +131,12 @@ export class PassphraseSettingsComponent implements OnInit, OnDestroy {
.subscribe(settings);
}
/** attribute binding for numWords[min] */
protected numWordsMin: number;
/** attribute binding for numWords[max] */
protected numWordsMax: number;
/** attribute binding for wordSeparator[maxlength] */
protected wordSeparatorMaxLength: number;