1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-14 07:13:32 +00:00

[PM-21073] No error when submitting empty form (#14597)

* Resolve the space in note and colon issue

* Resolve the max length for Note

* Revert the changes
This commit is contained in:
cyprain-okeke
2025-05-02 16:50:50 +01:00
committed by GitHub
parent ebe3e98a1f
commit e23bc6b77b
2 changed files with 7 additions and 4 deletions

View File

@@ -7,7 +7,7 @@
<div class="tw-grid tw-grid-cols-12 tw-gap-4">
<div class="tw-col-span-12">
<bit-form-field>
<bit-label>{{ "email" | i18n }}:</bit-label>
<bit-label>{{ "email" | i18n }}</bit-label>
<input
bitInput
inputmode="email"
@@ -19,13 +19,12 @@
</div>
<div class="tw-col-span-12">
<bit-form-field>
<bit-label>{{ "notes" | i18n }}:</bit-label>
<bit-label>{{ "notes" | i18n }}</bit-label>
<input
bitInput
inputmode="text"
formControlName="sponsorshipNote"
[attr.aria-invalid]="sponsorshipNoteControl.invalid"
appInputStripSpaces
/>
</bit-form-field>
</div>

View File

@@ -74,7 +74,9 @@ export class AddSponsorshipDialogComponent {
asyncValidators: [this.isOrganizationMember.bind(this)],
updateOn: "change",
}),
sponsorshipNote: new FormControl<string | null>("", {}),
sponsorshipNote: new FormControl<string | null>("", {
validators: [Validators.maxLength(1000)],
}),
});
}
@@ -86,6 +88,8 @@ export class AddSponsorshipDialogComponent {
}
protected async save() {
this.sponsorshipEmailControl.markAllAsTouched();
if (this.sponsorshipForm.invalid) {
return;
}