Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DataTable: Checkbox/Radio not respecting isDataSelectable #4492

Closed
melloware opened this issue Jun 7, 2023 · 0 comments · Fixed by #4493
Closed

DataTable: Checkbox/Radio not respecting isDataSelectable #4492

melloware opened this issue Jun 7, 2023 · 0 comments · Fixed by #4493
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component.
Milestone

Comments

@melloware
Copy link
Member

Describe the bug

When using Checkbox Row Selection mode the checkbox should be disabled if the isDataSelectable returns false for that row.

image

It should be displayed as disabled and not clickable. This will also allow it to be overridden if someone wants to hide the checkboxes entirely with display:none !

Reproducer

No response

PrimeReact version

9.5.0

React version

18.x

Language

TypeScript

Build / Runtime

Create React App (CRA)

Browser(s)

No response

Steps to reproduce the behavior

Make a

 <DataTable
                    value={products}
                    isDataSelectable={isRowSelectable}
                    selectionMode={'checkbox'}
                    selection={selectedProducts}
                    onSelectionChange={(e) => setSelectedProducts(e.value)}
                    dataKey="id"
                    tableStyle={{ minWidth: '50rem' }}
                >
                    <Column
                        selectionMode="multiple"
                        headerStyle={{ width: '3rem' }}
                    ></Column>
                    <Column field="code" header="Code"></Column>
                    <Column field="name" header="Name"></Column>
                    <Column field="category" header="Category"></Column>
                    <Column field="quantity" header="Quantity"></Column>
                </DataTable>

Expected behavior

Checkbox and Radio buttons should be disabled if isDataSelectable = false

@melloware melloware added Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible Type: Bug Issue contains a defect related to a specific component. and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Jun 7, 2023
@melloware melloware self-assigned this Jun 7, 2023
@melloware melloware modified the milestones: 10.0.0, 9.6.0 Jun 7, 2023
@github-actions github-actions bot added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 7, 2023
melloware added a commit to melloware/primereact that referenced this issue Jun 7, 2023
@melloware melloware removed the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jun 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a defect related to a specific component.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant