Component: TabMenu should initiate a change detection in itemClick method #12744
Labels
Type: Enhancement
Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone
Describe the bug
Hello!
I've just found out that the TabMenu is set to use
changeDetection: ChangeDetectionStrategy.OnPush
but although it has theChangeDetectorRef
injected, it doesn't use it in theitemClick
method.Under some circumstances this can cause the tab classes to not be updated properly because the following
ngClass
is not getting correct values :'p-highlight': isActive(item)
For me it happened because I use the mobx-angular library and I triggered an async action that stopped the change detection but I guess that it could happen with other cases too.
Environment
Angular 14.2.10
node 16.16.0
PrimeNG 14.2.3
Ubuntu 22
Reproducer
No response
Angular version
14.2.10
PrimeNG version
14.2.3
Build / Runtime
Angular CLI App
Language
TypeScript
Node version (for AoT issues node --version)
16.16.0
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
No response
The text was updated successfully, but these errors were encountered: