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

[Bug]: Table results do not filter after selecting a lookup filter #2062

Merged
merged 1 commit into from
Jun 21, 2020

Conversation

RDP07
Copy link
Contributor

@RDP07 RDP07 commented Jun 17, 2020

Related Issue

I was able to resolve the bug that does not filter the table results after clicking a lookup filter without creating an issue, but will open one if necessary

Description

After rendering a table that has a column containing a lookup, then in the UI after selecting a lookup filter from the Select dropdown the Table does not update with the filtered result set

Bug Demo: https://codesandbox.io/s/material-tablelookup-filter-bug-m9lmi?file=/src/App.js

Solution

Inside the m-table-filter-row.js component there is an onClose handler that passes event into this.props.onFilterChanged(columnDef.tableData.id, event.target.value);. When onClose is called event is undefined, which is the source of the bug. Since m-table-filter-row.js already has declared a piece of state that has the selectedFilter, I have updated the onClose handler to pass selectedFilter i.e. this.props.onFilterChanged(columnDef.tableData.id, selectedFilter); which resolves the bug and will actually filter the result set in the UI when a lookup filter is selected.

Impacted Areas in Application

List general components of the application that this PR will affect:

  • m-table-filter-row.js

@RDP07 RDP07 requested a review from mbrn as a code owner June 17, 2020 19:56
@DDynamic
Copy link
Contributor

Duplicate of #2022

Copy link
Owner

@mbrn mbrn left a comment

Choose a reason for hiding this comment

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

Thanks for contribution

@mbrn mbrn merged commit 9bc6df0 into mbrn:master Jun 21, 2020
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.

3 participants