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

Cannot read properties of undefined (reading 'parent') #3483

Open
paustint opened this issue Apr 6, 2024 · 0 comments
Open

Cannot read properties of undefined (reading 'parent') #3483

paustint opened this issue Apr 6, 2024 · 0 comments
Labels

Comments

@paustint
Copy link

paustint commented Apr 6, 2024

Describe the bug

I have been getting occasional errors logged to my bug tracker for an exception from react-data-grid, but I have been unable to reproduce the issue no matter what I have tried.

Keyboard navigation works for me in every complex case I can figure out.

Cannot read properties of undefined (reading 'parent')
TypeError: Cannot read properties of undefined (reading 'parent')
  File "../../../node_modules/react-data-grid/lib/bundle.js", line 227, in n$e
        let parent = nextColumn.parent;
  File "../../../node_modules/react-data-grid/lib/bundle.js", line 2531, in Gt
        const nextSelectedCellPosition = getNextSelectedCellPosition({
  File "../../../node_modules/react-data-grid/lib/bundle.js", line 2278, in vr
            navigate(event);
// src/utils/selectedCellUtils.ts

if (nextRowIdx < mainHeaderRowIdx) {
  const nextColumn = columns[nextIdx]; // This appears to return undefined
  let parent = nextColumn.parent; // error happens here
...
}
  1. Do you have any idea on what might be causing this?
  2. Would it be possible to defend against this exception by making sure that nextColumn is not undefined?

Environment

  • react-data-grid version: 7.0.0-beta.41
  • react/react-dom version: 18.2.0

All errors from bug tracker have been on Chrome and have happened on both windows and OSX, so I don't think is is OS related.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant