mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +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-grid tw-grid-cols-12 tw-gap-4">
|
||||||
<div class="tw-col-span-12">
|
<div class="tw-col-span-12">
|
||||||
<bit-form-field>
|
<bit-form-field>
|
||||||
<bit-label>{{ "email" | i18n }}:</bit-label>
|
<bit-label>{{ "email" | i18n }}</bit-label>
|
||||||
<input
|
<input
|
||||||
bitInput
|
bitInput
|
||||||
inputmode="email"
|
inputmode="email"
|
||||||
@@ -19,13 +19,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="tw-col-span-12">
|
<div class="tw-col-span-12">
|
||||||
<bit-form-field>
|
<bit-form-field>
|
||||||
<bit-label>{{ "notes" | i18n }}:</bit-label>
|
<bit-label>{{ "notes" | i18n }}</bit-label>
|
||||||
<input
|
<input
|
||||||
bitInput
|
bitInput
|
||||||
inputmode="text"
|
inputmode="text"
|
||||||
formControlName="sponsorshipNote"
|
formControlName="sponsorshipNote"
|
||||||
[attr.aria-invalid]="sponsorshipNoteControl.invalid"
|
[attr.aria-invalid]="sponsorshipNoteControl.invalid"
|
||||||
appInputStripSpaces
|
|
||||||
/>
|
/>
|
||||||
</bit-form-field>
|
</bit-form-field>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -74,7 +74,9 @@ export class AddSponsorshipDialogComponent {
|
|||||||
asyncValidators: [this.isOrganizationMember.bind(this)],
|
asyncValidators: [this.isOrganizationMember.bind(this)],
|
||||||
updateOn: "change",
|
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() {
|
protected async save() {
|
||||||
|
this.sponsorshipEmailControl.markAllAsTouched();
|
||||||
|
|
||||||
if (this.sponsorshipForm.invalid) {
|
if (this.sponsorshipForm.invalid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user