Skip to content

Commit

Permalink
feat: disabled keys
Browse files Browse the repository at this point in the history
  • Loading branch information
kostasdano committed Apr 22, 2024
1 parent d73783f commit bce43d8
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ const ColumnChooser: React.FC<Props> = ({ columns, columnsConfig }) => {
)
);

const disabledKeys = options
.filter((option) => option.isAlwaysVisible)
.map((option) => option.id);

const btnRef = useRef(null);

const handleBtnClick = (e) => {
Expand Down Expand Up @@ -78,6 +82,7 @@ const ColumnChooser: React.FC<Props> = ({ columns, columnsConfig }) => {
selectedKeys={selectedKeys}
css={[listStyle({}), menuStyle()]}
onSelectionChange={handleSelectionChange}
disabledKeys={disabledKeys}
>
{options.map((col, index) => {
const key = col.id;
Expand Down

0 comments on commit bce43d8

Please sign in to comment.