Skip to content

Commit a407f26

Browse files
authored
Merge pull request #2881 from IgniteUI/VSlavov/selection-header-fix
Fix - Selection - Selection header properly checks against filteredData
2 parents b2ea525 + 84c35a9 commit a407f26

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

projects/igniteui-angular/src/lib/grids/grid-base.component.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3659,12 +3659,13 @@ export abstract class IgxGridBaseComponent implements OnInit, OnDestroy, AfterCo
36593659
*/
36603660
public checkHeaderCheckboxStatus(headerStatus?: boolean) {
36613661
if (headerStatus === undefined) {
3662-
this.allRowsSelected = this.selection.are_all_selected(this.id, this.dataLength);
3662+
const dataLength = this.filteredData ? this.filteredData.length : this.dataLength;
3663+
this.allRowsSelected = this.selection.are_all_selected(this.id, dataLength);
36633664
if (this.headerCheckbox) {
36643665
this.headerCheckbox.indeterminate = !this.allRowsSelected && !this.selection.are_none_selected(this.id);
36653666
if (!this.headerCheckbox.indeterminate) {
36663667
this.headerCheckbox.checked =
3667-
this.selection.are_all_selected(this.id, this.dataLength);
3668+
this.allRowsSelected;
36683669
}
36693670
}
36703671
this.cdr.markForCheck();

0 commit comments

Comments
 (0)