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: cannot uncheck when click the checkbox in column #3691

Closed
cn2156 opened this issue Mar 2, 2023 · 4 comments
Closed

DataTable: cannot uncheck when click the checkbox in column #3691

cn2156 opened this issue Mar 2, 2023 · 4 comments
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@cn2156
Copy link

cn2156 commented Mar 2, 2023

Describe the bug

restore checkbox stop propagation in datatable checkbox from version 3.20

In version 3.21, if set selectionMode in , and checkbox select column, then the checkbox in column not checked currectly:
can not uncheck when click the checkbox in column

https://primevue.org/datatable/selection

With the example in document, add selectionMode="multiple" in <DataTable>

<DataTable :value="products" v-model:selection="selectedProducts3" selectionMode="multiple" dataKey="id" responsiveLayout="scroll" > <Column selectionMode="multiple" headerStyle="width: 3em"></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>

Reproducer

https://codesandbox.io/s/datatable-checkbox-error-upnwwc

PrimeVue version

3.21.0

Vue version

3.x

Language

TypeScript

Build / Runtime

Vue CLI App

Browser(s)

Chrome 110

Steps to reproduce the behavior

  1. checked two rows by click the checkbox in column
  2. click the first checked row to uncheck, then: the first checked row is still checked in step 1, the second checked row in step 1 is unchecked

Expected behavior

the first checked row will unchecked, and the second checked row will still checked, such as in version 3.20

@cn2156 cn2156 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 2, 2023
@cn2156 cn2156 changed the title DataTable: cannot uncheck when click the checkbox in column #3690 DataTable: cannot uncheck when click the checkbox in column Mar 2, 2023
@mertsincan
Copy link
Member

Hi,

There are already multiple selections in checkbox mode. So, you need to remove selectionMode="multiple" from DataTable component.

Best Regards,

@cn2156
Copy link
Author

cn2156 commented Mar 2, 2023

In a DataTable, can convenient select the row through click the row.
If need select more rows, check multiple checkbox.

Otherwise, stop propagation when click the checkbox is logical.

before version 3.21, stop propagation is used, why remove it?

@mertsincan mertsincan reopened this Mar 2, 2023
@mertsincan mertsincan changed the title #3690 DataTable: cannot uncheck when click the checkbox in column DataTable: cannot uncheck when click the checkbox in column Mar 2, 2023
@mertsincan mertsincan self-assigned this Mar 2, 2023
@mertsincan mertsincan added this to the 3.24.0 milestone Mar 2, 2023
@mertsincan mertsincan added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Mar 2, 2023
@mertsincan
Copy link
Member

You're right! I think stopPropagation should always be the last solution. So I made some changes. Fixed now. Thanks a lot for your update!

@cn2156
Copy link
Author

cn2156 commented Mar 3, 2023

OK

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants