Closed ramyab03 closed 2 years ago
Hi @ramyab03 Can you provide a minimal example reproducing the issue? You can start with this template or create one from scratch.
Also, make sure to take a look at renderCell
docs
@ramyab03 Actually, take a look at https://mui.com/components/data-grid/migration-v4/#removed-props - looks like it's what you're looking for :)
@ramyab03 Actually, take a look at https://mui.com/components/data-grid/migration-v4/#removed-props - looks like it's what you're looking for :)
Thank You @cherniavskii - Will take a look.
Maybe the basic componentsProps
usecases should be more documented so that we can link the real doc instead of the migration guide.
For instance a new Add custom cell / row listeners
section may be easier to understand than a componentsProps
generic section in a Components
page which looks like an advanced topic.
EDIT: Sidenote the Events
page name can be misleading since people can think it's the DOM events of the DataGrid, not our custom event system.
By default the Tooltip displays its label when its child element receives focus. For its child to receive focus via the keyboard, it needs to have a tabIndex
. This demo uses a IconButton so it has tabIndex=0
for free. In the DataGrid, the current focused cell has tabIndex=0
which makes the focus to always move to the cell when navigating with the arrows, so not showing the label. I'll wait for the reproduction to understand what you're trying to build, but I believe that only by not adding tabIndex
to the cell that contains the Tooltip does the trick, not requiring to listen for the events.
Here is the example - https://codesandbox.io/s/datagrid-v5-quick-start-forked-0t1wx?file=/src/App.tsx
Since the issue is missing key information, and has been inactive for 7 days, it has been automatically closed. If you wish to see the issue reopened, please provide the missing information.
I am re-opening it since we have a reproduction case
@ramyab03 In the example provided you're not using IconButton
but only non-interactive icons. Wrapping the icon in a IconButton
shows the tooltip when the cell gets focused.
By default the Tooltip displays its label when its child element receives focus. For its child to receive focus via the keyboard, it needs to have a
tabIndex
. This demo uses a IconButton so it hastabIndex=0
for free. In the DataGrid, the current focused cell hastabIndex=0
which makes the focus to always move to the cell when navigating with the arrows, so not showing the label. I'll wait for the reproduction to understand what you're trying to build, but I believe that only by not addingtabIndex
to the cell that contains the Tooltip does the trick, not requiring to listen for the events.
Hi, I have a follow up question on a similar issue (sorry, I understand this issue is closed. I will create a new issue if it's needed)
For GridCell, I resolved it using the same approach.
However, the same approach does not work on column header cell since it does not have hasFocus
. Column header tooltip is not displayed on keyboard focus navigation. Our requirement is to display tooltip on keyboard focus especially when header label is not fully displayed (ellipsis).
Any suggestion?
Duplicates
Latest version
Summary 💡
We are using MUI DataGrid @mui/x-data-grid in our React application.
In the DataGrid we have icons with ToolTip in 4 columns. We are using MUI ToolTip and Icons. The Tooltip title displays when we mouse hover the icon. Is there a way we can display Tooltip for keyboard users - when they enter/navigate to the cell using arrow keys?
Did not find any keyboard event for CellFocusIn - to set the Tooltip to open.
Examples 🌈
No response
Motivation 🔦
No response
Order ID 💳 (optional)
No response