kendo-react icon indicating copy to clipboard operation
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'.

Open ivan-kolesen opened this issue 10 months ago • 2 comments

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.

ivan-kolesen avatar Apr 19 '24 08:04 ivan-kolesen

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.

zdravkov avatar Apr 29 '24 06:04 zdravkov

Reported again in Ticket ID: 1650291

filipKovachev avatar Apr 30 '24 20:04 filipKovachev

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%',
      }}
    >

vveesseelliinnaa avatar May 29 '24 14:05 vveesseelliinnaa

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.

zdravkov avatar Jun 24 '24 05:06 zdravkov