Skip to content
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

Error encountered when decreasing the number of columns using a filter #3529

Open
Jialecl opened this issue Jun 17, 2024 · 0 comments
Open
Labels

Comments

@Jialecl
Copy link

Jialecl commented Jun 17, 2024

Describe the bug

I am not sure that my approach is the correct one, but I tried to add a select that works as a filter for the visible columns.
Whenever the number of columns is reduced I get this error:

image

image

It seems that the issue is caused by an undefined column added to rawColumns2:

image

To Reproduce

  1. I filtered the columns before passing them as a prop to the data grid based on the values of a multiple select input
  2. By default all options are selected and unselecting any option to filter out the column from the ones passed to the data grid causes this error.
let expectedColumns = columns
  .filter((column) => visibleColumns.includes(column.name))
  .map((column) => {
    return (column);
});

Expected behavior

The rawColumn should be ignored if undefined.

Environment

  • react-data-grid version: 7.0.0-beta.44
  • react/react-dom version: ^18.2.0
@Jialecl Jialecl added the Bug label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant