Skip to content

Commit

Permalink
Merge pull request #41 from klippa-app/Add_disable_option_form_submit
Browse files Browse the repository at this point in the history
Add option to add disable status to submit form button
  • Loading branch information
wouter-willems authored Feb 13, 2024
2 parents 597052d + 3a50c1c commit 9fa31d9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion projects/klippa/ngx-enhancy-forms/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@klippa/ngx-enhancy-forms",
"version": "14.13.0",
"version": "14.14.0",
"publishConfig": {
"access": "public"
},
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<klp-form-button
[variant]="variant"
(click)="submitForm()"
[disabled]="isLoading"
[disabled]="isLoading || disabled"
[isLoading]="isLoading"
[fullWidth]="fullWidth"
type="submit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export class FormSubmitButtonComponent {
@Input() public submitCallback: (renderedAndEnabledValues: object, renderedButDisabledValues: object) => Promise<any>;
@Input() public before: () => Promise<any> = () => Promise.resolve();
@Input() public after: () => Promise<any> = () => Promise.resolve();
@Input() public disabled: boolean = false;

private setValidationError = (e: FormValidationError) => {
this.parentForm.formGroup.get(e.path)?.setErrors({ message: { value: e.message }});
Expand Down

0 comments on commit 9fa31d9

Please sign in to comment.