Skip to content

Commit

Permalink
fix(module:readio): fix disabled still clickable in button style
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Jan 4, 2018
1 parent 0384eec commit 134916e
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/components/radio/nz-radio-button.component.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import {
Component,
HostBinding,
HostListener,
Input,
OnInit,
ViewEncapsulation,
ViewEncapsulation
} from '@angular/core';

import { toBoolean } from '../util/convert';
Expand Down Expand Up @@ -51,4 +52,14 @@ export class NzRadioButtonComponent extends NzRadioComponent implements OnInit {
get nzChecked(): boolean {
return this._radioButtonChecked;
}

@HostListener('click', [ '$event' ])
onClick(e: MouseEvent): void {
e.preventDefault();
if (!this._radioButtonDisabled) {
this._radioButtonChecked = true;
this.setClassMap();
if (this._nzRadioGroup) this._nzRadioGroup.selectRadio(this);
}
}
}

0 comments on commit 134916e

Please sign in to comment.