From b8f13537517930d4ebb06dfd7a3866663f50649e Mon Sep 17 00:00:00 2001 From: "nida.ghuman" Date: Mon, 23 Dec 2024 11:17:47 -0500 Subject: [PATCH] Fixes --- .../pb_advanced_table/Components/TableHeaderCell.tsx | 11 +++++------ .../docs/_advanced_table_column_headers.jsx | 4 ++-- .../docs/_advanced_table_column_headers_multiple.jsx | 4 ++-- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/playbook/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx b/playbook/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx index 32075a3e04..b95b4a354a 100644 --- a/playbook/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx +++ b/playbook/app/pb_kits/playbook/pb_advanced_table/Components/TableHeaderCell.tsx @@ -52,18 +52,17 @@ export const TableHeaderCell = ({ const isLeafColumn = header?.column.getLeafColumns().length === 1 && header?.column.getLeafColumns()[0].id === header.column.id + + const isLastHeaderCell = + header?.column.parent?.columns.at(-1) === header?.column || + (header?.colSpan > 1 && header?.column.parent !== undefined); const cellClassName = classnames( "table-header-cells", `${isChrome() ? "chrome-styles" : ""}`, `${enableSorting ? "table-header-cells-active" : ""}`, { "pinned-left": responsive === "scroll" && isPinnedLeft }, - `${ - header?.column.parent?.columns.at(-1) === header?.column || - (header?.colSpan > 1 && header?.column.parent !== undefined) - ? "last-header-cell" - : "" - }` + isLastHeaderCell ? "last-header-cell" : "" ); const cellId = `${loading ? diff --git a/playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx b/playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx index 49f6443e22..5c416ea495 100644 --- a/playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx +++ b/playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers.jsx @@ -47,13 +47,13 @@ const AdvancedTableColumnHeaders = (props) => { return ( -
+ <> -
+ ) } diff --git a/playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.jsx b/playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.jsx index da0ebf378d..becca4865a 100644 --- a/playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.jsx +++ b/playbook/app/pb_kits/playbook/pb_advanced_table/docs/_advanced_table_column_headers_multiple.jsx @@ -61,13 +61,13 @@ const AdvancedTableColumnHeadersMultiple = (props) => { ]; return ( -
+ <> -
+ ); };