diff --git a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx index 738f35dfb..4cad9b7c6 100644 --- a/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx +++ b/src/Explorer/Tabs/DocumentsTabV2/DocumentsTableComponent.tsx @@ -23,7 +23,7 @@ import { useTableColumnSizing_unstable, useTableFeatures, useTableSelection, - useTableSort + useTableSort, } from "@fluentui/react-components"; import { ArrowClockwise16Regular, @@ -164,9 +164,21 @@ export const DocumentsTableComponent: React.FC = } onClick={onRefreshTable}> Refresh - } onClick={(e) => setColumnSort(e, column.id, "ascending")}>Sort ascending - } onClick={(e) => setColumnSort(e, column.id, "descending")}>Sort descending - } onClick={(e) => setColumnSort(e, undefined, undefined)}>Reset sorting + } + onClick={(e) => setColumnSort(e, column.id, "ascending")} + > + Sort ascending + + } + onClick={(e) => setColumnSort(e, column.id, "descending")} + > + Sort descending + + } onClick={(e) => setColumnSort(e, undefined, undefined)}> + Reset sorting + } onClick={openColumnSelectionPane}> Edit columns @@ -316,21 +328,23 @@ export const DocumentsTableComponent: React.FC = sortDirection: getSortDirection(columnId), }); - const rows: TableRowData[] = sort(getRows((row) => { - const selected = isRowSelected(row.rowId); - return { - ...row, - onClick: (e: React.MouseEvent) => toggleRow(e, row.rowId), - onKeyDown: (e: React.KeyboardEvent) => { - if (e.key === " ") { - e.preventDefault(); - toggleRow(e, row.rowId); - } - }, - selected, - appearance: selected ? ("brand" as const) : ("none" as const), - }; - })); + const rows: TableRowData[] = sort( + getRows((row) => { + const selected = isRowSelected(row.rowId); + return { + ...row, + onClick: (e: React.MouseEvent) => toggleRow(e, row.rowId), + onKeyDown: (e: React.KeyboardEvent) => { + if (e.key === " ") { + e.preventDefault(); + toggleRow(e, row.rowId); + } + }, + selected, + appearance: selected ? ("brand" as const) : ("none" as const), + }; + }), + ); const toggleAllKeydown = React.useCallback( (e: React.KeyboardEvent) => {