From 5faa47cb3562208e5cbf4d52a7ec3cbbebe876c6 Mon Sep 17 00:00:00 2001 From: Domino987 Date: Sat, 29 Jan 2022 03:56:44 +0100 Subject: [PATCH] Fix: RenderSortButton renders content correctly --- src/components/MTableHeader/index.js | 37 +++++++++++++++------------- 1 file changed, 20 insertions(+), 17 deletions(-) diff --git a/src/components/MTableHeader/index.js b/src/components/MTableHeader/index.js index ec8b4c1b..62f92e7f 100644 --- a/src/components/MTableHeader/index.js +++ b/src/components/MTableHeader/index.js @@ -223,7 +223,6 @@ export function MTableHeader({ onColumnResized, ...props }) { : { position: 'relative', minWidth: 0, display: 'flex' } } > - {columnDef.title} {columnDef.sorting !== false && props.sorting && ( + > + {columnDef.title} + )} )} @@ -243,20 +244,19 @@ export function MTableHeader({ onColumnResized, ...props }) { ); } else if (columnDef.sorting !== false && props.sorting) { content = ( - <> + {columnDef.title} - - + ); } if (columnDef.tooltip) { @@ -454,7 +454,8 @@ function RenderSortButton({ orderDirection, icon, thirdSortClick, - onOrderChange + onOrderChange, + children }) { const active = orderBy === columnDef.tableData.id; // If current sorted column or prop asked to @@ -491,7 +492,9 @@ function RenderSortButton({ ); onOrderChange(columnDef.tableData.id, newOrderDirection); }} - /> + > + {children} + ); }