-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[DataGrid] Fix error when keyboard navigating an empty grid #10081
Conversation
Netlify deploy previewNetlify deploy preview: https://deploy-preview-10081--material-ui-x.netlify.app/ Updated pagesNo updates. These are the results for the performance tests:
|
packages/grid/x-data-grid/src/hooks/features/keyboardNavigation/useGridKeyboardNavigation.ts
Outdated
Show resolved
Hide resolved
IIRC,
This sounds better, a single source of truth to get the |
I've looked at the code, |
I've fixed what needed to be fixed, I'll leave the |
@@ -715,4 +715,19 @@ describe('<DataGrid /> - Keyboard', () => { | |||
fireEvent.keyDown(firstCell, { key: 'ArrowDown' }); | |||
expect(virtualScroller.scrollLeft).to.equal(0); | |||
}); | |||
|
|||
it('should not throw when moving into an empty grid', async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't look needed:
it('should not throw when moving into an empty grid', async () => { | |
it('should not throw when moving into an empty grid', () => { |
Closes #6446
Based on #6535 (comment)
@MBilalShafi I don't understand why this
?.
is needed because the type doesn't includenull | undefined
. Do you have more context?