primeng icon indicating copy to clipboard operation
primeng copied to clipboard

(v19) Default styles showing before custom styles with transition

Open romantulchak opened this issue 1 year ago • 5 comments

Describe the bug

I started using PrimeNG v19 with a new way to customize components and ran into this problem: I created my own preset to customize the button component by setting parameters like color, background, etc., and added to the page. The styles work fine on the first render, but when I switch pages, for example, from /page1 to /page2 (where there’s also a ), I notice that the default PrimeNG button style is applied first, and then my custom styles are applied with a transition. Has anyone had this issue? (angular)

Pull Request Link

No response

Reason for not contributing a PR

  • [ ] Lack of time
  • [X] Unsure how to implement the fix/feature
  • [ ] Difficulty understanding the codebase
  • [ ] Other

Other Reason

No response

Reproducer

https://stackblitz.com/edit/stackblitz-starters-rb9xgw9x

Environment

Windows 24H2

Angular version

19.0.0

PrimeNG version

v19

Node version

22.12.0

Browser(s)

Google Chrome

Steps to reproduce the behavior

  1. Click on page2
  2. Return to the page1
  3. The default button style is applied first, and then my custom styles are applied with a transition.

Expected behavior

  1. Click on page2
  2. Return to the page1
  3. My custom styles are applied without a transition.

romantulchak avatar Jan 12 '25 14:01 romantulchak

This is related to transition. Please try;

button: {
      transitionDuration: 0,
      colorScheme: {
...

https://stackblitz.com/edit/stackblitz-starters-5n4px7fv?file=src%2Fapp%2Fapp.config.ts%3AL745

Best Regards,

mertsincan avatar Jan 16 '25 09:01 mertsincan

This is related to transition. Please try;

button: { transitionDuration: 0, colorScheme: { ... https://stackblitz.com/edit/stackblitz-starters-5n4px7fv?file=src%2Fapp%2Fapp.config.ts%3AL745

Best Regards,

That's not fixing the problem it's just turning off all button transitions. I have a similar issue with text buttons initially showing a border that then fades to transparent. That's happening on inital page load as well as on route changes. And also not related to customized buttons. It's the same when using Aura preset.

makuko avatar Feb 12 '25 15:02 makuko

Did anyone find a solution for this? We have the same issue on v20.

https://stackblitz.com/edit/dszabo-primeng-transition-issue?file=src%2Fapp%2Fapp.ts

https://github.com/user-attachments/assets/df360d4b-1bc2-41d6-9568-8f51a7c4b648

david-szabo97 avatar Oct 09 '25 09:10 david-szabo97

hi, i am quite new to primeng and angular in general. i am facing a similar situation for the drag effects, after overriding my opacity properties for the drag element it wont reflect. the transitions styles puts the opacity dynamically and sometimes the opacity is not even same. any help will be appriciated.

rashi12122001 avatar Oct 28 '25 04:10 rashi12122001

I'm using Angular 20V and I'm also facing the same problem. Has any valid solution been found?

victormarinho1 avatar Nov 22 '25 19:11 victormarinho1