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

Data Table row checkboxes propagate click events leading to double-handling of row select/unselect #3605

Closed
BoThomas opened this issue Jan 29, 2023 · 4 comments

Comments

@BoThomas
Copy link

Describe the bug

Row checkboxes in data table don't stop event propagation.
If a data table uses selectionMode="multiple" as well as a column with selectionMode="multiple", click events will fire twice, e.g. unselecting and then reselecting the row.

The same Bug was reported on Mar. 4, 2022 in issue #2259. Fixed in 3.13 with #2260, but apparently reintroduced in a later version.

Reproducer

https://codesandbox.io/s/epic-scott-cxx2h5?file=/src/App.vue

PrimeVue version

3.22.4

Vue version

3.x

Language

ALL

Build / Runtime

Vite

Browser(s)

No response

Steps to reproduce the behavior

See the CodeSandbox for demo, or create a data table with selectionMode="multiple" as well as a column with selectionMode="multiple"

  1. Click on the first row to select it
  2. Click on the first checkbox to try to unselect the row

The row is still selected because the click triggers both the checkbox's and the row's @click events.

Expected behavior

Row checkbox stops event propagation so click events don't fire twice, e.g. unselecting and then reselecting the row from just one click

@BoThomas BoThomas added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Jan 29, 2023
@BoThomas
Copy link
Author

BoThomas commented Feb 1, 2023

Fix in Pull-Request #3613

@tugcekucukoglu
Copy link
Member

I have created a demo https://stackblitz.com/edit/angular-3qwyq2?file=src%2FApp.vue and can't see the problem.

@tugcekucukoglu tugcekucukoglu added Resolution: Cannot Replicate Issue could not be replicated by Core Team 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 9, 2023
@github-actions
Copy link

github-actions bot commented Mar 9, 2023

We're unable to replicate your issue, if you are able to create a reproducer or add details please edit this issue. This issue will be closed if no activities in 20 days.

@BoThomas
Copy link
Author

BoThomas commented Mar 9, 2023

I didn't look closer where exactly, but the problem was fixed within version 3.24.0.

When I select primevue version 3.23.0 in my CodeSandbox Demo the problem persists, with 3.24.0 it is solved.
Therefore your demo also works using version 3.24.0.

Thanks for the effort looking into this and have a nice day!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants