From 9efbe7d0569f4a46444f314af2d53cd89baae75e Mon Sep 17 00:00:00 2001 From: Laurent Nguyen Date: Thu, 11 Jul 2024 10:04:43 +0200 Subject: [PATCH] Don't allow unselecting last column --- .../TableColumnSelectionPane/TableColumnSelectionPane.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Explorer/Panes/TableColumnSelectionPane/TableColumnSelectionPane.tsx b/src/Explorer/Panes/TableColumnSelectionPane/TableColumnSelectionPane.tsx index e7e97636f..8796b572f 100644 --- a/src/Explorer/Panes/TableColumnSelectionPane/TableColumnSelectionPane.tsx +++ b/src/Explorer/Panes/TableColumnSelectionPane/TableColumnSelectionPane.tsx @@ -35,6 +35,10 @@ export const TableColumnSelectionPane: React.FC = if (checked) { selectedColumnIdsSet.add(id); } else { + if (selectedColumnIdsSet.size === 1 && selectedColumnIdsSet.has(id)) { + // Don't allow unchecking the last column + return; + } selectedColumnIdsSet.delete(id); } setNewSelectedColumnIds([...selectedColumnIdsSet]);