mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-29 00:47:01 +00:00
Don't allow unselecting last column
This commit is contained in:
parent
ea2ab19518
commit
9efbe7d056
@ -35,6 +35,10 @@ export const TableColumnSelectionPane: React.FC<TableColumnSelectionPaneProps> =
|
|||||||
if (checked) {
|
if (checked) {
|
||||||
selectedColumnIdsSet.add(id);
|
selectedColumnIdsSet.add(id);
|
||||||
} else {
|
} else {
|
||||||
|
if (selectedColumnIdsSet.size === 1 && selectedColumnIdsSet.has(id)) {
|
||||||
|
// Don't allow unchecking the last column
|
||||||
|
return;
|
||||||
|
}
|
||||||
selectedColumnIdsSet.delete(id);
|
selectedColumnIdsSet.delete(id);
|
||||||
}
|
}
|
||||||
setNewSelectedColumnIds([...selectedColumnIdsSet]);
|
setNewSelectedColumnIds([...selectedColumnIdsSet]);
|
||||||
|
Loading…
Reference in New Issue
Block a user