kendo-react
kendo-react copied to clipboard
[Bug][Grid] Grid component breaks when the data is an empty array and the scrollable attribute is set to 'none'.
I'm submitting a...
- Regression report
Current behavior
When the data={[]} and scrollable='none', Grid component breaks, displaying the error:
Error in /turbo_modules/@progress/[email protected]/Grid.js (8:20657)
Cannot read properties of null (reading 'clientWidth')
Expected behavior
It functioned properly in versions prior to 7.0.0. The component should not break. Instead, it should display a full-width message saying 'No records available'.
Minimal reproduction of the problem with instructions
See https://stackblitz.com/edit/react-rbxsyy?file=app%2Fmain.jsx
Environment
Package versions:
@progress/kendo-react-grid@^7.4.0
P.S.
After removing scrollable='none', the message 'No records available' appears ugly and fails to stretch to the full width of the table.
It looks like a bug indeed, thank you for reporting it. We will do our best to fix this as soon as possible.
If you observe other issues or you have other questions regarding our components or their specific configuration you can also consider submitting a support ticket on our support platform where we do our best to provide a more advanced dedicated support.
Reported again in Ticket ID: 1650291
Reported again in Ticket ID: 1653448
Possible workaround is to enable the scrolling when the data is empty:
<Grid
data={[]}
scrollable={data.length > 0 ? 'none' : 'scrollable'}
style={{
width: '100%',
}}
>
Fixed in the 'dev' npm channel of KendoReact Grid (https://stackblitz.com/edit/react-rbxsyy-srsafa?file=package.json) and will be officially released in the next couple of days.