From fb95561cb8ce033adf60cd55faf3d7579b799a6a Mon Sep 17 00:00:00 2001 From: Chris McKnight Date: Fri, 31 Jul 2020 00:31:51 -0500 Subject: [PATCH] fix(beforeChange): Skip beforeChange when disabled --- src/lib/ui-switch/ui-switch.component.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/ui-switch/ui-switch.component.ts b/src/lib/ui-switch/ui-switch.component.ts index 3d6b27dd..7f0d8b40 100644 --- a/src/lib/ui-switch/ui-switch.component.ts +++ b/src/lib/ui-switch/ui-switch.component.ts @@ -154,6 +154,9 @@ export class UiSwitchComponent implements ControlValueAccessor, OnDestroy { @HostListener('click', ['$event']) onToggle(event: MouseEvent) { + if (this.disabled) { + return; + } if (this.beforeChange) { this._beforeChange = this.beforeChange.subscribe((confirm: boolean) => { if (confirm) {