From 4d8ddc72de1a9285eaede66a405ddedbc1e87d43 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 13 Sep 2023 17:31:28 +0000 Subject: [PATCH] Fix filter actions on data table vis cells (#4837) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix filter actions on data table vis cells * Add changelog entry --------- Signed-off-by: Eva Millán Signed-off-by: Josh Romero Co-authored-by: Miki Co-authored-by: Josh Romero Co-authored-by: Anan Zhuang (cherry picked from commit a9255811ef0721ec0800065e8c06a0b3c312d171) Signed-off-by: github-actions[bot] # Conflicts: # CHANGELOG.md --- .../public/components/table_vis_component.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/plugins/vis_type_table/public/components/table_vis_component.tsx b/src/plugins/vis_type_table/public/components/table_vis_component.tsx index c0e4ab61ae8b..3d7602e9a991 100644 --- a/src/plugins/vis_type_table/public/components/table_vis_component.tsx +++ b/src/plugins/vis_type_table/public/components/table_vis_component.tsx @@ -37,7 +37,7 @@ export const TableVisComponent = ({ event, uiState: { sort, setSort, colWidth, setWidth }, }: TableVisComponentProps) => { - const { rows, formattedColumns } = table; + const { rows, columns, formattedColumns } = table; const pagination = usePagination(visConfig, rows.length); @@ -59,7 +59,15 @@ export const TableVisComponent = ({ formattedColumns, ]); - const dataGridColumns = getDataGridColumns(table, event, colWidth); + const sortedTable = useMemo(() => { + return { + rows: sortedRows, + columns, + formattedColumns, + }; + }, [sortedRows, columns, formattedColumns]); + + const dataGridColumns = getDataGridColumns(sortedTable, event, colWidth); const sortedColumns = useMemo(() => { if (