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: Card #15013

Closed
BenoitPE opened this issue Mar 11, 2024 · 1 comment · Fixed by #15371
Closed

Component: Card #15013

BenoitPE opened this issue Mar 11, 2024 · 1 comment · Fixed by #15371
Assignees
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@BenoitPE
Copy link

BenoitPE commented Mar 11, 2024

Describe the bug

Given a card with style like so:

<p-card [style]="cardStyle">
</p-card>

When updating style:

  cardStyle = { background: 'lightblue' };

  ngAfterViewInit(): void {
      this.cardStyle = { background: 'red' };
  }

Style is not updating on the card

Environment

Using Angular 17 and PrimeNG in 17.10.0 version.

Reproducer

No response

Angular version

17.2.2

PrimeNG version

17.10.0

Build / Runtime

Angular CLI App

Language

TypeScript

Node version (for AoT issues node --version)

21.4.0

Browser(s)

Chrome

Steps to reproduce the behavior

No response

Expected behavior

No response

@BenoitPE BenoitPE 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 11, 2024
@mehmetcetin01140 mehmetcetin01140 added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Mar 18, 2024
@RemiPeruto
Copy link
Contributor

Hello @BenoitPE
I investigated a bit and I found that in the card component you are not allowed to do such modifications because of the Change detection strategy is set to onPush. https://angular.io/api/core/ChangeDetectionStrategy

I propose a modification to allow the Default Change Detection Strategy but it is a breaking change in the card component.

@cetincakiroglu cetincakiroglu modified the milestones: 17.15.0, 17.14.0 Apr 18, 2024
cetincakiroglu added a commit that referenced this issue Apr 26, 2024
nbrown-ScottLogic pushed a commit to nbrown-ScottLogic/primeng that referenced this issue May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants