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: when using v-model:selection the checkbox appears checked when the table has no items #2637

Closed
nestorrente opened this issue Jun 6, 2022 · 0 comments · Fixed by #2638
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@nestorrente
Copy link
Contributor

Describe the bug

When using v-model:selection in the DataTable component, the selection checkbox appears checked even when the table has no items.

Reproducer

https://codesandbox.io/s/sharp-dubinsky-c7ifo9?file=/src/App.vue

PrimeVue version

3.12.6

Vue version

3.x

Language

TypeScript

Build / Runtime

Vite

Browser(s)

Any

Steps to reproduce the behavior

  1. Create an empty table with a "select all" column.
  2. Bind the selection using v-model:selection.
  3. The selection checkbox appears checked even when the table has no rows.

Expected behavior

If the table has no rows, the selection checkbox should not be checked.

@nestorrente nestorrente added the Type: Bug Issue contains a bug related to a specific component. Something about the component is not working label Jun 6, 2022
mertsincan pushed a commit that referenced this issue Jun 8, 2022
* Fix allRowsSelected computed property

This fixes the issue described in #2637.

* Remove optional chaining operator

Replaced by ObjectUtils.isNotEmpty().
@mertsincan mertsincan added this to the 3.13.2 milestone Jun 8, 2022
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

Successfully merging a pull request may close this issue.

2 participants