You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
instructions: scroll to the right then click autosize. Unexpected error is thrown.
Problem description:
Error is thrown and column is not resized as expected. It is expected that a column should be resized when calling the method.
When we scroll, as soon as first column is out of the screen its virtualized. When calling setColumnSizeAuto with a virtualized column, then it will throw an error. Note: only if skipHeaders = false
Suggested solution:
Validate that the cell is not undefined or use optional chaining
useColumnsSizing.js
headerCells.find(function (cell) {
var cellProps = cell?.props;
if (cellProps?.id === column.id) {
headerCell = cell.getDOMNode();
}
});
The text was updated successfully, but these errors were encountered:
lfpose
changed the title
馃悰 Bug:
馃悰 Bug: setColumnSizeAuto throws when virtualization is enabled
Nov 6, 2023
lfpose
changed the title
馃悰 Bug: setColumnSizeAuto throws when virtualization is enabled
馃悰 Bug: setColumnSizeAuto throws when column virtualization is enabled
Nov 6, 2023
So my guess is that the cell is sometimes undefined because it gets skipped from getCells(). That's why it triggers the error "Cannot read properties of undefined (reading 'props')".
It doesn't happen when skipHeader is true, because it doesn't enter this part (I think)
what edition are you using - community / enterprise
enterprise
version for
@inovua/reactdatagrid-community
or@inovua/reactdatagrid-enterprise
5.10.2
What you did:
Try to set column size auto with skipHeaders = false and virtualization enabled.
What happened:
Error is thrown, because its trying to read a property from an undefined value.
Error in reactdatagrid code:
useColumnsSizing.js
This throws an error when
cell
is undefined.cell
is undefined if grid has many columns and is using virtualizationReproduction
https://codesandbox.io/s/wandering-sun-dzgx34?file=/src/App.js
instructions: scroll to the right then click autosize. Unexpected error is thrown.
Problem description:
Error is thrown and column is not resized as expected. It is expected that a column should be resized when calling the method.
When we scroll, as soon as first column is out of the screen its virtualized. When calling setColumnSizeAuto with a virtualized column, then it will throw an error. Note: only if skipHeaders = false
Suggested solution:
Validate that the cell is not undefined or use optional chaining
useColumnsSizing.js
The text was updated successfully, but these errors were encountered: