From 58743b8b8db1755d9716b6c4b09522e589feefab Mon Sep 17 00:00:00 2001 From: Hsuan Lee Date: Wed, 30 Jan 2019 11:24:40 +0800 Subject: [PATCH] fix(module:radio): children unable to focus in radio label (#2850) close #2774 --- components/radio/nz-radio.component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/components/radio/nz-radio.component.ts b/components/radio/nz-radio.component.ts index ad3b7e35dbf..fb801039ce7 100644 --- a/components/radio/nz-radio.component.ts +++ b/components/radio/nz-radio.component.ts @@ -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) {