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/
3.91k stars 1.19k forks source link

[data grid] Support scrolling in any direction #13551

Open Janpot opened 1 week ago

Janpot commented 1 week ago

Summary

trying to scroll diagonally (e.g. with the trackpad). But the grid only scrolls in one direction at a time, either horizontally or vertically, it's a very jarring experience when I want to move diagonally:

https://github.com/mui/mui-x/assets/2109932/c5501061-b2c3-4773-bf28-a86c7f3fcbff

It would be great if I could scroll the grid in both directions at the same time. i.e. scroll diagonally.

I just noticed there is an issue https://github.com/mui/mui-x/issues/11230 And it makes sense that for small deviations from the main axes you may not want to have the drift. Maybe it makes sense to measure the angle that is being scrolled from one of the main axes and snap to that axis as long as this angle stays under a certain threshold?

Examples

I know it's not 100% the same use-case, but Google Sheets can do it:

https://github.com/mui/mui-x/assets/2109932/13a1e659-0a7d-494f-9f12-aba9bb593f76

Motivation

This would greatly increase the UX as it would require less distance to scroll and the grid responsiveness would closer resemble what I'm doing physically with my trackpad.

Search keywords: datagrid scroll diagonaly

michelengelen commented 1 week ago

👍🏼