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: cellSelection type doesn't allow boolean values, only false or undefined #6376

Closed
gcodecraft opened this issue Apr 11, 2024 · 1 comment · Fixed by #6378, leoo1992/GeradorQRCode#23 or leoo1992/GeradorQRCode#27
Assignees
Labels
Type: Bug Issue contains a defect related to a specific component. Typescript Issue or pull request is *only* related to TypeScript definition
Milestone

Comments

@gcodecraft
Copy link

gcodecraft commented Apr 11, 2024

Describe the bug

Trying to implement a DataTable that triggers an action when I only select/click on a specific cell instead of the entire row, I found from the documentation that you enable this functionality by setting cellSelection.
Looking into the datatable.d.ts file I see that this is:

    /**
     * Whether to cell selection is enabled or not.
     * @defaultValue false
     */
    cellSelection?: false | undefined;

Basically it does not allow setting cellSelection to true. The documentation says the same thing here.

I do not thing it's intended as if I //@ts-ignore this I am able to click the cells and launch the aforementioned action.
Shouldn't the type be cellSelection?: boolean | undefined so it allows selecting a single cell?

P.S. (LE) I can contribute with the type fix if it's up for grabs :)

Thank you!

Reproducer

No response

PrimeReact version

10.6.3

React version

18.x

Language

TypeScript

Build / Runtime

Next.js

Browser(s)

No response

Steps to reproduce the behavior

No response

Expected behavior

No response

@gcodecraft gcodecraft added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Apr 11, 2024
@melloware melloware added Typescript Issue or pull request is *only* related to TypeScript definition and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 11, 2024
@melloware melloware self-assigned this Apr 11, 2024
@melloware melloware added this to the 10.6.4 milestone Apr 11, 2024
melloware added a commit to melloware/primereact that referenced this issue Apr 11, 2024
@melloware
Copy link
Member

Thanks for reporting PR submitted!

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. Typescript Issue or pull request is *only* related to TypeScript definition
Projects
None yet
3 participants