primeng icon indicating copy to clipboard operation
primeng copied to clipboard

Multiselect: headerCheckboxViewChild not found

Open MaksymPlotnikov opened this issue 2 years ago • 1 comments

Describe the bug

image

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

  1. Add appendTo="body" attribute for multi-select and add with custom filterTemplate
  2. Click on 'Select all' checkbox in the panel header.

Demo: https://stackblitz.com/edit/8cwxx3

Expected behavior

No errors in console

MaksymPlotnikov avatar Feb 06 '24 20:02 MaksymPlotnikov

The same issue...

volkorros avatar Feb 07 '24 12:02 volkorros