Skip to content

Commit

Permalink
fix(module:radio): children unable to focus in radio label (#2850)
Browse files Browse the repository at this point in the history
close #2774
  • Loading branch information
hsuanxyz authored and vthinkxie committed Jan 30, 2019
1 parent bfb1ed9 commit 58743b8
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions components/radio/nz-radio.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ export class NzRadioComponent implements ControlValueAccessor, AfterViewInit, On
}
}

@HostListener('click')
onClick(): void {
this.focus();
@HostListener('click', ['$event'])
onClick(event: MouseEvent): void {
// Prevent label click triggered twice.
event.stopPropagation();
event.preventDefault();
if (!this.nzDisabled && !this.checked) {
this.select$.next(this);
if (this.isNgModel) {
Expand Down

0 comments on commit 58743b8

Please sign in to comment.