From a7a4906df09db877f16bb11fa956b30392a7d9ee Mon Sep 17 00:00:00 2001 From: Egor Volvachev Date: Fri, 20 Jan 2023 10:47:13 +0300 Subject: [PATCH] fix(primeng/p-tableRadioButton): update logic for component with `checked` and `focused` states Fixes #12511. --- src/app/components/table/table.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/app/components/table/table.ts b/src/app/components/table/table.ts index 10b8e189a30..ed3a601a39a 100644 --- a/src/app/components/table/table.ts +++ b/src/app/components/table/table.ts @@ -3832,9 +3832,9 @@ export class CellEditor implements AfterContentInit { @Component({ selector: 'p-tableRadioButton', template: ` -
+
- +
@@ -3860,13 +3860,15 @@ export class TableRadioButton { @Input() ariaLabel: string; + @ViewChild('rb') inputViewChild: ElementRef; + checked: boolean; focused: boolean; subscription: Subscription; - constructor(public dt: Table, public tableService: TableService, public cd: ChangeDetectorRef) { + constructor(public dt: Table, public cd: ChangeDetectorRef) { this.subscription = this.dt.tableService.selectionSource$.subscribe(() => { this.checked = this.dt.isSelected(this.value); this.cd.markForCheck(); @@ -3886,6 +3888,8 @@ export class TableRadioButton { }, this.value ); + + this.inputViewChild.nativeElement?.focus(); } DomHandler.clearSelection(); }