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

Column: PT not getting applied for headerCheckbox #7050

Closed
skj-skj opened this issue Aug 14, 2024 · 10 comments · Fixed by #7053 · May be fixed by leoo1992/GeradorQRCode#95
Closed

Column: PT not getting applied for headerCheckbox #7050

skj-skj opened this issue Aug 14, 2024 · 10 comments · Fixed by #7053 · May be fixed by leoo1992/GeradorQRCode#95
Assignees
Labels
Component: Unstyled Issue related to unstyled/passthrough attributes
Milestone

Comments

@skj-skj
Copy link
Contributor

skj-skj commented Aug 14, 2024

Describe the bug

according to the docs for Column PT
https://primereact.org/datatable/#pt.column.options

headerCheckbox is available to pass props to Checkbox component but props are not getting applied.

I saw there was similar issue which was fixed #6978 but the file change were in DataTable which doesn't have headerCheckbox pt as per docs

Reproducer

Stackblitz Project with headerCheckbox issue

System Information

PrimeReact: 10.8.2
React: 18.3.1
Vite: 5.4.0

Steps to reproduce the behavior

No response

Expected behavior

props should passed to the checkbox component of headerCheckbox

@skj-skj skj-skj added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 14, 2024
@melloware melloware added Status: Needs Reproducer Issue needs a runnable reproducer and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 14, 2024
Copy link

Please fork the Stackblitz project and create a case demonstrating your bug report. This issue will be closed if no activities in 20 days.

@melloware
Copy link
Member

cc @peconomou929 since we just fixed this can you help out @skj-skj ?

@skj-skj
Copy link
Contributor Author

skj-skj commented Aug 15, 2024

Hi @melloware,

I created a Stackblitz project for this issue. In this project, I updated the style of the checkboxes using PrimeFlex classes.

In the CheckboxTablePT component, the rowCheckbox PT works fine as the styles are applied correctly. but the headerCheckbox PT is not working as expected, and the styles are not being applied.

Click on checkbox on the table header to view the behaviour.

@melloware
Copy link
Member

Thanks I will take a look.

@peconomou929
Copy link
Contributor

I agree that this is a bug, and what you demonstrate is indeed unexpected behaviour.

However, another way to achieve what you want is to use the "column" entry in the DataTablePassThroughOptions, instead of setting the ColumnPassThroughOptions on the Column itself. That usage is precisely what got fixed in #6979 and #6939.

@melloware
Copy link
Member

Oh i see there is a headerCheckbox on the DT and one on the Column. You are right that is confusing.

@melloware melloware added Component: Unstyled Issue related to unstyled/passthrough attributes and removed Status: Needs Reproducer Issue needs a runnable reproducer labels Aug 15, 2024
@skj-skj
Copy link
Contributor Author

skj-skj commented Aug 15, 2024

@peconomou929 Thanks that workaround works.
I have updated the Stackblitz reproducer project and added the workaround.

this pattern makes sense as in most cases a DataTable will have only one column as checkbox. so instead of pt individual column for headerCheckbox and rowCheckbox it make sense to pt only DataTable.

@melloware
Copy link
Member

yeah now i am wondering if headerCheckbox should be removed from the Column definition.

melloware added a commit to melloware/primereact that referenced this issue Aug 15, 2024
@melloware melloware added this to the 10.8.3 milestone Aug 15, 2024
@melloware melloware self-assigned this Aug 15, 2024
@melloware
Copy link
Member

OK PR submitted

melloware added a commit to melloware/primereact that referenced this issue Aug 15, 2024
@skj-skj
Copy link
Contributor Author

skj-skj commented Aug 15, 2024

@melloware thanks for taking care of this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Unstyled Issue related to unstyled/passthrough attributes
Projects
None yet
3 participants