-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[DataGrid] Add touch support on column resize #537
[DataGrid] Add touch support on column resize #537
Conversation
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- On Android, I can no longer sort
- On iOS it sorts when I resize
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
packages/grid/_modules_/grid/components/styled-wrappers/GridRootStyles.ts
Outdated
Show resolved
Hide resolved
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
The hover style gets persisted on mobile, fixed in d8df748. |
…e/DataGrid-416-column-resize-mobile-support
…ithub.com:DanailH/material-ui-x into feature/DataGrid-416-column-resize-mobile-support
@DanailH Well done :). We don't have any resizing tests for the mouse part of the logic. I think that we could consider adding some, but I think that it can be merged without. We could wait to solve a regression to add them. |
c4f72cd
to
1551072
Compare
…ithub.com:DanailH/material-ui-x into feature/DataGrid-416-column-resize-mobile-support
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
packages/grid/_modules_/grid/hooks/features/useColumnResize.tsx
Outdated
Show resolved
Hide resolved
* Add support for touch column resize * Change the touch start event listner from the separator to the document * Allow resizing on mobile only when column separator is touched * fix hover * Attach touchStart event to the columns header element, not the document * Add support for touch column resize * Change the touch start event listner from the separator to the document * Allow resizing on mobile only when column separator is touched * Attach touchStart event to the columns header element, not the document * fix hover * minimize git diff * Use findParentElementFromClassName dom util * Add new findHeaderElementFromField dom util Co-authored-by: Olivier Tassinari <[email protected]>
Fixes #416
This PR adds the ability to resize columns on touch devices. The solution was taken from the
Slider
component that is part of the core repo -> https://github.com/mui-org/material-ui/blob/0d0e370c6e783f967fbd922ac925f576bee2b9ae/packages/material-ui/src/Slider/Slider.js#L675Preview: https://deploy-preview-537--material-ui-x.netlify.app/components/data-grid/#commercial-version