primefaces / primeng

The Most Complete Angular UI Component Library
https://primeng.org
Other
9.53k stars 4.47k forks source link

Table's select all checkbox shouldn't select the checkbox which are disabled #15338

Open Bhaveshshah777 opened 2 weeks ago

Bhaveshshah777 commented 2 weeks ago

Describe the bug

When user clicks on p-tableHeaderCheckbox all p-tableCheckbox in that table are selected. Even those which are disabled.

Expectation: It should not select those record whose p-tableCheckbox is disabled.

Environment

Windows 11, Angular 12, Node 14.21.3, PrimeNg 16

Reproducer

https://stackblitz.com/edit/stackblitz-starters-hjrvss?file=src%2Fmain.ts

Angular version

17.2.0

PrimeNG version

17.14.1

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

18.18.0

Browser(s)

Mozilla Firefox

Steps to reproduce the behavior

  1. Wait for data to load in the p-table
  2. Click on p-tableHeaderCheckbox (select all) checkbox
  3. Observe the selection

Actual result: Even the disabled checkboxes are selected.

Expected behavior

When select all checkbox is selected, all disabled row should not be selected

Bhaveshshah777 commented 2 weeks ago

@cetincakiroglu

cetincakiroglu commented 2 weeks ago

@Bhaveshshah777 could you please update the stackblitz link, it's broken.

Bhaveshshah777 commented 2 weeks ago

@cetincakiroglu I have updated the stackblitz link, could you try again?

cetincakiroglu commented 1 week ago

Please update the example, it's not clear. Screenshot 2024-05-03 at 16 01 07

Bhaveshshah777 commented 1 week ago

When clicked on select all checkbox even disabled checkboxes are being selected, which I think should not. As once disabled, you cannot click on it and mark it as checked. The only way to mark a disabled checkbox check is via select all checkbox, which I feel is not as intended. Please verify.

Bug