-
-
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
[data grid] Consider making new option for disable cell focus outline #2429
Comments
I find it weird to be able to focus a cell but to have no visual feedback on it |
Yes. |
Did you apply const useStyles = makeStyles({
root: {
"& .MuiDataGrid-cell:focus-within, & .MuiDataGrid-cell:focus": {
outline: "none"
}
}
}); However, if you're trying to create a "read-only" grid, without any interaction, then #2113 might be what you're looking for. In this case, it requires more work than only removing the outline. |
Yes, by doing so the outline becomes invisible but I think we need a prop. So, this is the point to introduce the new prop
@m4theushw Do you think this is overkill? |
No, in this case it makes sense. What I was trying to say ealier is that if the requirement is to only remove the outline, keeping the everything as it is, then CSS can be used. But since you raised the need to also disable cell navigation and the tabIndex calculation, then we could provide a prop to address it properly. Just a quick heads up. You don't need to use |
In my opinion, it is still worth considering to make the new option even if only requirement is to remove the outline. This is the steps they might experience
This is why I said
|
I'm in favor of thinking of a new prop, even if it's not implemented straight away.
We also have to make sure that the cell and row edition modes are either forbidden when this prop is provided OR have a correct behavior. |
@flaviendelangle Currently, setting the
In #2113, the user still wants to edit cells. |
I would also like this to be a prop option. I want to select rows, not individual cells. The individual cell focus is distracting in my case. |
Can u please provide an example... how can we do with sx props. |
@wahajStar and others coming for example with sx props:
Maybe this could become a recipe until we have the prop, @cherniavskii. |
This is what I want/came looking for. I don't want a spread sheet with cells, I just want rows. |
Adding another vote for a prop - In some cases you only want to select rows. |
Disabling focus tracking altogether (with a prop) would reduce state changes in a In my case, interaction with the grid would still be possible because of on-click handlers. Perhaps this use-case is too niche to care about, but I personally really don't need focus tracking. Keeping the focus state |
@joserodolfofreitas |
@wahajStar, |
When disabling the cell focus as suggested, the grid does no longer shoe the cell focus but only selects the complete row, but this selection no longer moves when using the keyboard navigation. |
it works but the border of mui datagrid header is still shown |
I found this to work for me. |
Ideally this should be handled via prop. |
I don't need the outline when cell focused. I couldn't find an easy way to remove the outline.
Summary 💡
I expect to use the option like this.
Motivation 🔦
In my project, x-grid is used not only for data, but also for community board. The community board just need some basic feature of the x-grid and it looks awkward with the outline.
Order id 💳
#27772
The text was updated successfully, but these errors were encountered: