Skip to content

Commit

Permalink
Merge pull request #16306 from Marcio-H/master
Browse files Browse the repository at this point in the history
Fix #16304 Table: editable column is broken when disabled temporarily
  • Loading branch information
cetincakiroglu authored Sep 26, 2024
2 parents 3120e14 + 870e56c commit d4cd2f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/app/components/table/table.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4169,7 +4169,9 @@ export class EditableColumn implements OnChanges, AfterViewInit, OnDestroy {
constructor(public dt: Table, public el: ElementRef, public zone: NgZone) {}

public ngOnChanges(changes: SimpleChanges): void {
if (this.el.nativeElement && !changes.data?.firstChange) {
if (changes.pEditableColumnDisabled?.currentValue === true && DomHandler.hasClass(this.el.nativeElement, 'p-cell-editing')) {
this.closeEditingCell(false, new Event('cancel'));
} else if (changes.data?.firstChange === false && this.el.nativeElement) {
this.dt.updateEditingCell(this.el.nativeElement, this.data, this.field, <number>this.rowIndex);
}
}
Expand Down

0 comments on commit d4cd2f4

Please sign in to comment.