Closed wladimir-k-m closed 5 months ago
Hey @wladimir-k-m thanks for raising this issue. The adjusted area size comes from a change we introduced in d9ac050aea0b9a03a959a67e6a71c923d5562351. It was meant to increase performance of the cell rendering. Not sure about the performance implication of this specific change. That is something @romgrk would be best to answer here.
Just a quick question @wladimir-k-m: Does this prove to be a problem in your case?
@michelengelen It looks odd and is inconsistent across browsers. It's not a show stopper of course but it does lower the visual quality of an otherwise nice looking grid component.
OK, so it is basically a cosmetic issue (with a slight dent in a11y). I will add this to the board, so we can check how to improve this.
The change in cell structure is similar to what other grid components have. I have inspected a bit what the other components are doing to deal with text selection: most of them just don't allow native text selection. Any selection goes through grid cell/row selection: https://mui.com/x/react-data-grid/cell-selection/. It's just that we allow text selection when there is no row/cell selection.
The line-height is set to 100% height to vertically align text, if we can find an alternative to that we can remove the line-height.
But other grids are also having the same behavior: https://ag-grid.com/react-data-grid/selection-overview/#cell-text-selection
It would be possible for users to re-add a wrapper using renderCell
, but that has performance implications in particular for scrolling.
Ok, thanks for the investigation @romgrk. If the visual change has performance implications I think it's better to leave it the way it is. You can close the issue.
:warning: This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue. Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.
@wladimir-k-m: How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.
Steps to reproduce
Steps:
In v6 the text selection area is as expected: https://v6.mui.com/x/react-data-grid/layout/#predefined-dimensions
Current behavior
No response
Expected behavior
The same minimum bounding box for text selection highlighting as in v6.
Context
No response
Your environment
The issue seems to happen only in Chromium based browsers. Tested: Chrome: Version 124.0.6367.119 Edge: Version 124.0.2478.80
It looks fine in Firefox.
Search keywords: data grid, text selection, text highlighting Order ID: 83276