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:
@@ -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>
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user