Skip to content

Table cell editing: Tab key navigation regression in v21 (works in v20) #19236

@vinydanylo

Description

@vinydanylo

Description

Tab key navigation between editable table cells stopped working in PrimeNG v21, but works correctly in v20.

Current Behavior

When editing a cell in a table with editMode="cell" and pEditableColumn:

  • Pressing Tab key does nothing (focus does not move to the next editable cell)
  • Instead, focus moves to the next focusable element outside the table (e.g., action buttons like delete icons)

Expected Behavior

When pressing Tab key while editing a cell:

  • Focus should move to the next editable cell in the table
  • Shift+Tab should move to the previous editable cell
  • This is how it works in PrimeNG v20.4.0

Steps to Reproduce

  1. Create a table with multiple editable columns using editMode="cell" and pEditableColumn
  2. Click on a cell to enter edit mode
  3. Press the Tab key
  4. Observe that focus does not move to the next editable cell

Code Example

@Component({
  template: `
    <p-table [value]="items" editMode="cell">
      <ng-template pTemplate="header">
        <tr>
          <th>Field 1</th>
          <th>Field 2</th>
          <th>Field 3</th>
        </tr>
      </ng-template>
      <ng-template pTemplate="body" let-item>
        <tr>
          <td pEditableColumn>
            <p-cellEditor>
              <ng-template pTemplate="input">
                <input pInputText [(ngModel)]="item.field1" />
              </ng-template>
              <ng-template pTemplate="output">
                {{ item.field1 }}
              </ng-template>
            </p-cellEditor>
          </td>
          <td pEditableColumn>
            <p-cellEditor>
              <ng-template pTemplate="input">
                <input pInputText [(ngModel)]="item.field2" />
              </ng-template>
              <ng-template pTemplate="output">
                {{ item.field2 }}
              </ng-template>
            </p-cellEditor>
          </td>
          <td pEditableColumn>
            <p-cellEditor>
              <ng-template pTemplate="input">
                <input pInputText [(ngModel)]="item.field3" />
              </ng-template>
              <ng-template pTemplate="output">
                {{ item.field3 }}
              </ng-template>
            </p-cellEditor>
          </td>
        </tr>
      </ng-template>
    </p-table>
  `
})

Environment

  • PrimeNG version: 21.0.2 (broken) vs 20.4.0 (works)
  • Angular version: 21.0.6
  • Browser: All browsers affected
  • Operating System: Windows 11

Additional Context

The v21 migration guide (https://primeng.org/migration/v21) mentions changes to the animation system (Angular animations → CSS animations) but does not document any changes to table cell editing or keyboard navigation behavior.

This appears to be an undocumented regression as:

  1. Tab navigation worked in v20
  2. No breaking changes are mentioned in the migration guide for Table component
  3. The official documentation (https://primeng.org/table#cell-edit) does not describe built-in tab navigation, but it existed in v20

Related Issues

Similar historical issues with tab navigation:

Metadata

Metadata

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not working

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions