primeng
primeng copied to clipboard
Multiselect: headerCheckboxViewChild not found
Describe the bug
ViewChild input headerCheckboxViewChild with appendTo="body" and custom filterTemplate cannot be found since overlay is not a view child.
Possible solution:
Please add optional chaining inside onToggleAll method since nativeElement of undefined.
DomHandler.focus(this.headerCheckboxViewChild?.nativeElement);
And provide a possibility to pass this custom template checkbox as a headerCheckboxViewChild to component
Environment
PrimeNG 17.5.0
Reproducer
No response
Angular version
17.1.1
PrimeNG version
17.5.0
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
20.11.0
Browser(s)
No response
Steps to reproduce the behavior
- Add appendTo="body" attribute for multi-select and add with custom
filterTemplate - Click on 'Select all' checkbox in the panel header.
Demo: https://stackblitz.com/edit/8cwxx3
Expected behavior
No errors in console
The same issue...