Component: AccordionTab.toggle(null) throws TypeError #13872
Labels
Type: Bug
Issue contains a bug related to a specific component. Something about the component is not working
Milestone
Describe the bug
event
is an optional parameter in .toggle(). When omitted or passed null, it throws an error due to the following line lacking null safety:primeng/src/app/components/accordion/accordion.ts
Line 286 in 1483287
Throws:
TypeError: Cannot read properties of undefined (reading 'preventDefault')
Environment
N/A
Reproducer
No response
Angular version
^16.2.0
PrimeNG version
~16.4.1
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
18.12.0
Browser(s)
No response
Steps to reproduce the behavior
accordionTab.toggle()
where accordionTab is a child componentExpected behavior
No error is thrown after adding null safety
The text was updated successfully, but these errors were encountered: