mirror of
https://github.com/bitwarden/browser.git
synced 2024-09-18 02:41:15 +02:00
[CL-243] honor initial disabled state in bitFormButton
(#9510)
* honor initial disabled state * update story
This commit is contained in:
parent
1cfbcf4ee0
commit
419c107f87
@ -40,13 +40,13 @@ export class BitFormButtonDirective implements OnDestroy {
|
|||||||
if (this.type === "submit") {
|
if (this.type === "submit") {
|
||||||
buttonComponent.loading = loading;
|
buttonComponent.loading = loading;
|
||||||
} else {
|
} else {
|
||||||
buttonComponent.disabled = loading;
|
buttonComponent.disabled = this.disabled || loading;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
submitDirective.disabled$.pipe(takeUntil(this.destroy$)).subscribe((disabled) => {
|
submitDirective.disabled$.pipe(takeUntil(this.destroy$)).subscribe((disabled) => {
|
||||||
if (this.disabled !== false) {
|
if (this.disabled !== false) {
|
||||||
buttonComponent.disabled = disabled;
|
buttonComponent.disabled = this.disabled || disabled;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,7 @@ const template = `
|
|||||||
<button class="tw-mr-2" type="submit" buttonType="primary" bitButton bitFormButton>Submit</button>
|
<button class="tw-mr-2" type="submit" buttonType="primary" bitButton bitFormButton>Submit</button>
|
||||||
<button class="tw-mr-2" type="button" buttonType="secondary" bitButton bitFormButton>Cancel</button>
|
<button class="tw-mr-2" type="button" buttonType="secondary" bitButton bitFormButton>Cancel</button>
|
||||||
<button class="tw-mr-2" type="button" buttonType="danger" bitButton bitFormButton [bitAction]="delete">Delete</button>
|
<button class="tw-mr-2" type="button" buttonType="danger" bitButton bitFormButton [bitAction]="delete">Delete</button>
|
||||||
|
<button class="tw-mr-2" type="button" buttonType="secondary" bitButton bitFormButton [disabled]="true">Disabled</button>
|
||||||
<button class="tw-mr-2" type="button" buttonType="secondary" bitIconButton="bwi-star" bitFormButton [bitAction]="delete">Delete</button>
|
<button class="tw-mr-2" type="button" buttonType="secondary" bitIconButton="bwi-star" bitFormButton [bitAction]="delete">Delete</button>
|
||||||
</form>`;
|
</form>`;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user