Open
Description
Steps to reproduce
Steps:
- Open this link to live example: https://stackblitz.com/edit/react-wphxoc24?file=Demo.tsx
- Open the developer tools console
- Focus on a cell
- Hit any keyboard key and/or click on a cell
- The api references passed to the onCellKeyDown, onCellClick handlers are null or undefined
Current behavior
The Grid API references in the params
and details
arguments of the onCellKeyDown
and onCellClick
event handler are undefined or null.
Expected behavior
I expect the grid cell params argument to contain a reference to the Grid API as described here https://mui.com/x/api/data-grid/grid-cell-params/
Context
I am trying to apply a custom cell keydown event handler to all Datagrid in our project using the theme. My use case requires the use of the Grid API. I'm not defining the event handler inside of a React component so I don't have access to the hooks which return a reference to the Grid API
Your environment
npx @mui/envinfo
System:
OS: macOS 12.7.3
Binaries:
Node: 21.7.1 - /opt/homebrew/bin/node
npm: 10.5.0 - /opt/homebrew/bin/npm
pnpm: Not Found
Browsers:
Chrome: 133.0.6943.142
Edge: Not Found
Safari: 15.6.1
Search keywords: cell event handler api null undefined
Metadata
Metadata
Assignees
Projects
Status
🆕 Needs refinement