Skip to content

Conversation

sai6855
Copy link
Contributor

@sai6855 sai6855 commented Apr 12, 2025

closes #16866

@sai6855 sai6855 marked this pull request as draft April 12, 2025 12:13
Copy link

github-actions bot commented Apr 12, 2025

Thanks for adding a type label to the PR! 👍

@sai6855 sai6855 changed the title [DataGrid] Fix Cell event handlers props have null|undefined API refe… [DataGrid] Fix Cell event handlers props have null|undefined API reference Apr 12, 2025
@sai6855 sai6855 added type: bug It doesn't behave as expected. scope: data grid Changes related to the data grid. labels Apr 12, 2025
@mui-bot
Copy link

mui-bot commented Apr 12, 2025

Deploy preview: https://deploy-preview-17335--material-ui-x.netlify.app/

Generated by 🚫 dangerJS against 09746ac

@sai6855 sai6855 requested a review from Copilot April 12, 2025 12:50
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (2)

packages/x-data-grid/src/hooks/features/rows/useGridParamsApi.ts:78

  • Replacing 'null as any' with 'apiRef.current' should correctly pass the API instance to the cell event parameters. Verify that apiRef.current is available at this point to avoid potential runtime issues.
api: apiRef.current,

packages/x-data-grid-pro/src/tests/events.DataGridPro.test.tsx:126

  • The test now passes the API reference as expected; ensure that this change consistently reflects the updated behavior of the production code.
api: apiRef.current,

@sai6855 sai6855 changed the title [DataGrid] Fix Cell event handlers props have null|undefined API reference [DataGrid] Fix apiRef not being passed on onCellClick params Apr 12, 2025
@sai6855 sai6855 marked this pull request as ready for review April 12, 2025 13:48
@sai6855 sai6855 requested a review from michelengelen April 12, 2025 13:48
@sai6855
Copy link
Contributor Author

sai6855 commented Apr 24, 2025

ping @michelengelen

Copy link
Member

@michelengelen michelengelen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :shipit:

@michelengelen michelengelen added needs cherry-pick The PR should be cherry-picked to master after merge. v7.x labels Apr 24, 2025
@michelengelen michelengelen merged commit 2b10901 into mui:master Apr 24, 2025
25 checks passed
Copy link

Cherry-pick PRs will be created targeting branches: v7.x

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs cherry-pick The PR should be cherry-picked to master after merge. scope: data grid Changes related to the data grid. type: bug It doesn't behave as expected. v7.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[data grid] Cell event handlers props have null|undefined API reference
3 participants