Skip to content
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] Tab key functionality is broken when using DatePicker within the MUI DataGrid #15965

Open
vlastocom opened this issue Dec 21, 2024 · 4 comments · May be fixed by #15967
Open

[data grid] Tab key functionality is broken when using DatePicker within the MUI DataGrid #15965

vlastocom opened this issue Dec 21, 2024 · 4 comments · May be fixed by #15967
Labels
component: data grid This is the name of the generic UI component, not the React module! customization: logic Logic customizability status: waiting for author Issue with insufficient information

Comments

@vlastocom
Copy link

vlastocom commented Dec 21, 2024

Related page

https://mui.com/x/react-data-grid/custom-columns/#date-pickers

Kind of issue

Broken demo

Issue description

Well, kind of broken. Integrating MUI DatePickers this way has one downside: If you switch to editMode="row" for your grid, the tab key can no longer be used to move between the fields in the edited row. And if you select a date (dateTime) field, you cannot use the tab key to move out. I wonder if there is an easy way to fix this?

Steps to reproduce:

  1. Click on the "open in CodeSandbox" button under the code for the demo in this section
  2. Change line 167 to: <DataGrid rows={rows} columns={columns} editMode="row" />
  3. Go to the demo pane
  4. Double-click the first column in any row (the row will become editable)
  5. Use the tab key to move to the next cell (works)
  6. Use the tab key to move to the date cell after (broken)
  7. Use shift-tab key to move to the first cel again (works)

Context

I simply want to integrate DatePicker (which is much more eye-pleasing and robust to my DataGrid implementation, but have to edit my grid in the "row" mode, not the "cell" mode.

Search keywords: TAB DataGrid DatePicker broken

@vlastocom vlastocom added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: docs-feedback Feedback from documentation page labels Dec 21, 2024
@vlastocom
Copy link
Author

Oh... one more thing. In the above steps, if in the point 4 double-click the row in the third column, the row becomes editable, but the DateTimePicker in the fourth column becomes focused instead (unexpected) and the tab key can't be used at all to move to other editable fields.

@k-rajat19 k-rajat19 linked a pull request Dec 21, 2024 that will close this issue
1 task
@k-rajat19
Copy link
Contributor

Hi,
you have to handle focus manually when the cell receives focus

Oh... one more thing. In the above steps, if in the point 4 double-click the row in the third column, the row becomes editable, but the DateTimePicker in the fourth column becomes focused instead (unexpected) and the tab key can't be used at all to move to other editable fields.

remove autoFocus prop

@michelengelen
Copy link
Member

Hi, you have to handle focus manually when the cell receives focus

Oh... one more thing. In the above steps, if in the point 4 double-click the row in the third column, the row becomes editable, but the DateTimePicker in the fourth column becomes focused instead (unexpected) and the tab key can't be used at all to move to other editable fields.

remove autoFocus prop

@vlastocom could you try the provided workaround?

@michelengelen michelengelen added component: data grid This is the name of the generic UI component, not the React module! status: waiting for author Issue with insufficient information customization: logic Logic customizability and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: docs-feedback Feedback from documentation page labels Dec 23, 2024
@michelengelen michelengelen changed the title Tab key functionality is broken when using DatePicker within the MUI DataGrid [data grid] Tab key functionality is broken when using DatePicker within the MUI DataGrid Dec 23, 2024
@LukasTy
Copy link
Member

LukasTy commented Dec 23, 2024

Having an autoFocus set with editMore="row" does not sound optimal.
As for when this prop is removed, I think there are still some problems with navigation, could @mui/xgrid check this? 🤔

Screen.Recording.2024-12-23.at.18.14.53.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: data grid This is the name of the generic UI component, not the React module! customization: logic Logic customizability status: waiting for author Issue with insufficient information
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants