Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Component: TabMenu should initiate a change detection in itemClick method #12744

Closed
NickTsitlakidis opened this issue Mar 13, 2023 · 0 comments
Closed
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@NickTsitlakidis
Copy link
Contributor

Describe the bug

Hello!

I've just found out that the TabMenu is set to use changeDetection: ChangeDetectionStrategy.OnPush but although it has the ChangeDetectorRef injected, it doesn't use it in the itemClick 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

@NickTsitlakidis NickTsitlakidis added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Mar 13, 2023
@cetincakiroglu cetincakiroglu added Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Apr 25, 2023
@cetincakiroglu cetincakiroglu added this to the 15.4.2 milestone Apr 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
Development

No branches or pull requests

2 participants