-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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] Custom Columns: How to improve usability of the Date Picker in a narrow column #13079
Comments
Hey @theobrasseurbentley |
OK, so I did play around with this a bit and it is not possible with the current version. We would need a ref for the Popper to know where to render. We could actually do this when we would pass the diff --git a/packages/x-data-grid/src/components/cell/GridCell.tsx b/packages/x-data-grid/src/components/cell/GridCell.tsx
index 81a23061e..fb1cf8e9b 100644
--- a/packages/x-data-grid/src/components/cell/GridCell.tsx
+++ b/packages/x-data-grid/src/components/cell/GridCell.tsx
@@ -429,6 +429,7 @@ const GridCell = React.forwardRef<HTMLDivElement, GridCellProps>((props, ref) =>
row: updatedRow,
formattedValue,
...editCellStateRest,
+ ref: cellRef,
};
children = column.renderEditCell(params); that way we would also be able to provide some more flexibility in rendering edit cells. Thoughts @cherniavskii or @romgrk ? |
@theobrasseurbentley ... the best way would probably be to assign a const columns: GridColDef[] = [
// ...
{
field: 'createdAt',
headerName: 'Created at',
type: 'date',
minWidth: 180,
editable: true,
},
// ...
]; |
Hey @theobrasseurbentley ... I did find a solution with Popper that works: Example Let me know what you think! 👍🏼 |
Thank you @michelengelen ! |
@theobrasseurbentley: 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. |
The problem in depth
Using the demo: https://mui.com/x/react-data-grid/custom-columns/#date-pickers
It is hard to enter a date in full. How to make it easier?
The normal edit cell behaves better.
Your environment
`npx @mui/envinfo`
Search keywords: Custom Columns DatePicker
Order ID: 82553
The text was updated successfully, but these errors were encountered: