mui / mui-x

MUI X: Build complex and data-rich applications using a growing list of advanced React components, like the Data Grid, Date and Time Pickers, Charts, and more!
https://mui.com/x/
4.56k stars 1.33k forks source link

Datagrid scrolls when pressing space bar if editing enabled #14713

Open laikai0000 opened 2 months ago

laikai0000 commented 2 months ago

Summary

Current behavior 😯 The datagrid jumps/scrolls when an editable cell is selected and the space bar is pushed. Expected behavior 🤔 The datagrid should not scroll and either: Pressing the space bar has the identical effect to a double-click or pressing enter on a selected cell

Examples

No response

Motivation

No response

Search keywords: DataGrid Order ID: 11111

MBilalShafi commented 2 months ago

Hey @laikai0000

Once you are in edit mode (by 1. double click, 2. pressing enter, 3. starting typing), you could add space afterward. Isn't that working for you like this?

Or your request is to trigger edit mode when the user presses Space key on an editable cell currently not in edit mode? I think that would be the reverse of https://github.com/mui/mui-x/pull/8180

This is an interesting discussion though and has also been raised previously. I couldn't find the ideal behavior according to the ARIA spec, I'd personally prefer not to let the user activate edit mode on the Space key as I'd generally not expect users to start typing from Space character.

Open to suggestions though, could be a behavioral change candidate for v8.

CC @mui/xgrid