Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table: Selectable row tabbing does not work on sort or page change #17630

Open
1 of 4 tasks
khobabc opened this issue Feb 10, 2025 · 0 comments
Open
1 of 4 tasks

Table: Selectable row tabbing does not work on sort or page change #17630

khobabc opened this issue Feb 10, 2025 · 0 comments
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible

Comments

@khobabc
Copy link

khobabc commented Feb 10, 2025

Describe the bug

In a paginated or sortable grid, where single row selection is enabled, if user change page or sort a column then tab does move focus to any rows, clicking on row makes the tab work again, but that defeats the purpose.

The reason for this issue is that in table.ts, in pSelectableRow directive, tabIndex is returned based on following condition:

Image

At first load anchorRowIndex is undefined and index is also undefined so it works and rows are selectable via tabbing, but on page change or sort anchorRowIndex is set as null which does not equal undefined so tab index is set to -1 for rows and rows are no longer tab accessible.

Pull Request Link

No response

Reason for not contributing a PR

  • Lack of time
  • Unsure how to implement the fix/feature
  • Difficulty understanding the codebase
  • Other

Other Reason

No response

Reproducer

https://v18.primeng.org/table#stateful

Environment

I test it on PrimeNG showcase.

Angular version

18.2.12

PrimeNG version

v18 (LTS Only)

Node version

18.20.2

Browser(s)

No response

Steps to reproduce the behavior

  1. Open the link to PrimeNG 18 showcase: https://v18.primeng.org/table#stateful
  2. Click on Global Search field, and the start pressing tab, and you would see focus moves to rows eventually.
  3. Now either sort on column, or change page, and try step 2 again, you would see that focus moves from header to pagination and never goes to rows.

Expected behavior

Even after page change or column sort applied, rows should be accessible via tab.

@khobabc khobabc added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible
Projects
None yet
Development

No branches or pull requests

1 participant