Skip to content

Commit 65761f4

Browse files
committed
fix: ignoring when an event is received and the column doesn't match any existing column in the table
1 parent 8d17a44 commit 65761f4

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

dash_tabulator/src/lib/components/DashTabulator.react.js

+8-4
Original file line numberDiff line numberDiff line change
@@ -96,24 +96,28 @@ export default class DashTabulator extends React.Component {
9696
}
9797

9898
handleFilterEvent = (event) => {
99-
console.log(`AMJ -`,event)
10099
const data = event.data;
101100
if (!data || data.type !== 'filters') return;
102-
101+
103102
const filters = data.filters;
104103
if (filters.length === 0) {
105104
this.setState({ includedNoteIds: [], excludedNoteIds: [] });
106105
this.tabulator.clearFilter();
107106
return;
108107
}
109-
108+
110109
const filter = filters[0];
111110
if (!filter.active || filter.filterType !== 'ALPHANUM_FACET') {
112111
this.setState({ includedNoteIds: [], excludedNoteIds: [] });
113112
this.tabulator.clearFilter();
114113
return;
115114
}
116-
115+
116+
const columnFields = this.props.columns.map(col => col.field);
117+
if (!columnFields.includes(filter.column)) {
118+
return;
119+
}
120+
117121
const { includedValues, excludedValues } = extractFilterValues(filter);
118122
this.updateFilterState(includedValues, excludedValues);
119123
this.applyTableFilter(filter, includedValues, excludedValues);

dss-plugin-visual-edit/python-lib/dash_tabulator/dash_tabulator.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)