Skip to content

Fix column identification after filtering #506

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

Merged
merged 1 commit into from
Mar 12, 2022

Conversation

Chee7ah
Copy link
Contributor

@Chee7ah Chee7ah commented Mar 11, 2022

Related Issue

#505

Description

The changeFilterValue method of the data manager is incorrectly using the columnId as an index. Generally this does not cause an issue, even though conceptually they are different values, because the columnIds are initialized from the indexes

However if a column is drag and dropped to a different position, then the columnIds and the column indexes are no longer guaranteed to match. To resolve this issue, took the logic for identifying a column from changeGroupOrder, which correctly handles the columnId.

Impacted Areas in Application

  • data-manager, filtering functionality

Additional Notes

Looked through the data-manager, the only other instance I've found where we use the column id as an index is in setColumns, when we look for the prevColumn. Theoretically this could break as well, if the same list of columns, but reordered, is passed to <MaterialTable />, but not quite sure how we'd fix it, without giving up looking for the prevColumn altogether.

Copy link
Contributor

@Domino987 Domino987 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the fix. I'll release it over the weekend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants