Skip to content

Commit

Permalink
Merge pull request #5799 from matuzalemsteles/LPD-22031
Browse files Browse the repository at this point in the history
fix(@clayui/core): fixes bug when changing column visibility when there is only one column visible and disabled
  • Loading branch information
matuzalemsteles committed Apr 8, 2024
2 parents 9d77e9d + bdfcd86 commit 661de58
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions packages/clay-core/src/table/Head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,20 @@ function HeadInner<T extends Record<string, any>>(
) : (
<Item
key={item}
onClick={() =>
onClick={() => {
if (
visibleColumns.has(item) &&
visibleColumns.size === 1
) {
return;
}

onVisibleColumnsChange(
item,
collection.getItem(item)
.index
)
}
);
}}
tabIndex={-1}
textValue={
collection.getItem(item).value
Expand Down

0 comments on commit 661de58

Please sign in to comment.