From 419c107f87a9b1d57cfc27f643913b9b60330c27 Mon Sep 17 00:00:00 2001 From: Will Martin Date: Wed, 5 Jun 2024 11:39:40 -0400 Subject: [PATCH] [CL-243] honor initial disabled state in `bitFormButton` (#9510) * honor initial disabled state * update story --- libs/components/src/async-actions/form-button.directive.ts | 4 ++-- libs/components/src/async-actions/in-forms.stories.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/libs/components/src/async-actions/form-button.directive.ts b/libs/components/src/async-actions/form-button.directive.ts index 5fe40423644..4e0facf17b2 100644 --- a/libs/components/src/async-actions/form-button.directive.ts +++ b/libs/components/src/async-actions/form-button.directive.ts @@ -40,13 +40,13 @@ export class BitFormButtonDirective implements OnDestroy { if (this.type === "submit") { buttonComponent.loading = loading; } else { - buttonComponent.disabled = loading; + buttonComponent.disabled = this.disabled || loading; } }); submitDirective.disabled$.pipe(takeUntil(this.destroy$)).subscribe((disabled) => { if (this.disabled !== false) { - buttonComponent.disabled = disabled; + buttonComponent.disabled = this.disabled || disabled; } }); } diff --git a/libs/components/src/async-actions/in-forms.stories.ts b/libs/components/src/async-actions/in-forms.stories.ts index ff060c6a7de..ec6005dd607 100644 --- a/libs/components/src/async-actions/in-forms.stories.ts +++ b/libs/components/src/async-actions/in-forms.stories.ts @@ -33,6 +33,7 @@ const template = ` + `;