Skip to content

Commit

Permalink
Merge pull request #417 from webcat12345/disabled-before-change
Browse files Browse the repository at this point in the history
fix(beforeChange): Skip beforeChange when disabled
  • Loading branch information
cmckni3 authored Aug 7, 2020
2 parents 2d37c5a + fb95561 commit 8e304ae
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/lib/ui-switch/ui-switch.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 8e304ae

Please sign in to comment.