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

DataTable (Virtual Scroll): Cannot set properties of undefined (setting 'tabIndex') #3888

Closed
LiamRiddell opened this issue Apr 24, 2023 · 11 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@LiamRiddell
Copy link

LiamRiddell commented Apr 24, 2023

Describe the bug

The issue has been raised and closed before incorrectly see #3650. The major DataTable changes mentioned in #3682 does not fix this issue.

image
Source:

DomHandler.find(body, 'tr.p-selectable-row')[index].tabIndex = '0';

Reproducer

https://stackblitz.com/edit/angular-7eg97z?file=src%2FApp.vue

PrimeVue version

3.27.0

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

  1. Open developer console.
  2. Select and existing row on screen and you should see a log message with "Index X".
  3. Scroll down a few hundred rows and click another row. It throws an exception:
    image
  4. Clicking the row again will then show the correct log message "Index X".

Expected behavior

There shouldn't be an error and the row is selected correctly the first time and does not require a secondary click to change the row correctly.

@LiamRiddell LiamRiddell added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 24, 2023
@LiamRiddell LiamRiddell changed the title DataTable (Virtual Scroll): Uncaught TypeError: Cannot set properties of undefined (setting 'tabIndex') DataTable (Virtual Scroll): Cannot set properties of undefined (setting 'tabIndex') Apr 24, 2023
@Cersin
Copy link

Cersin commented May 10, 2023

same problem

@chrisnoden
Copy link

I get the error clicking on any row that isn't on page 1 of a paginated datatable

@itsserbin
Copy link

same problem

@nnyiri
Copy link

nnyiri commented May 17, 2023

I get the error clicking on any row that isn't on page 1 of a paginated datatable

The same here.
It's pretty disturbing...

@barthy-koeln
Copy link
Contributor

I have opened PR #3984 to fix this issue. I have mainly tested it on paginated datatables.
The problem of removed DOM nodes is the same though.

@LiamRiddell
Copy link
Author

Great, thank you @barthy-koeln. I was going to come back around and put a PR in but you beat me to it!

@1993garik
Copy link

Hello @barthy-koeln, the problem solution is not published yet, right ?

@christianschoenmakers
Copy link

We use the row-click emit to trigger a redirect to a new page, this is also resulting in the same error.

@4ddev
Copy link

4ddev commented Jul 10, 2023

The issue persists; however, there is a specific pattern in my case. The datatable functions as expected within a single paginated page. However, when I navigate to a different page within the same pagination, the error is triggered once. After that initial occurrence, the error does not appear again until another page change occurs.

@barthy-koeln
Copy link
Contributor

@1993garik and the rest :)

I have given up on keeping the PR up to date. I was going to look into actually fixing the tabindex changes but got discouraged seeing the 5000+ lines files of vanilla JS and direct DOM manipulation in Vue.js files.

@tugcekucukoglu tugcekucukoglu added this to the 3.31.0 milestone Jul 21, 2023
@tugcekucukoglu tugcekucukoglu self-assigned this Jul 21, 2023
@tugcekucukoglu tugcekucukoglu modified the milestones: 3.33.1, 3.33.2 Sep 5, 2023
@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Sep 6, 2023
@reksc
Copy link

reksc commented Sep 12, 2023

I'm getting the same error at 3.41.1.

targetRow is null and so setting tabIndex = '0' fails.

attn @tugcekucukoglu

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.