Grid with selection that supports scrolling on mobile
Environment
Product Version | 7.0.2 |
Product | Progress® KendoReact Grid |
Description
When enabling selection for the Grid using the selectable prop, scrolling does not work using mobile. This is because screen scrolling will trigger the selection.
Solution
Use checkbox selection instead. You can enable checkbox selection only when the Grid is used in a mobile machine. This will allow using the built-in selectable
property when using a desktop or laptop, and only checkbox selection with a mobile machine.
Here is an example with the described approach, where we are importing the useDeviceType
method from the isMobile.jsx
file. This method is used when setting the selectable
property of the Grid such that it is set to null
when the device type is either a mobile or tablet. This leaves us with only the checkbox selection:
For more information about enabling checkbox selection, check the following example from the Grid Selection article: