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

Visible delay when applying primereact css in nextjs project #5606

Closed
gygabyte017 opened this issue Dec 17, 2023 · 1 comment
Closed

Visible delay when applying primereact css in nextjs project #5606

gygabyte017 opened this issue Dec 17, 2023 · 1 comment
Labels
Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted

Comments

@gygabyte017
Copy link

Describe the bug

I noticed that when a nextjs page is loaded, you can see on the screen some partial css applied and, after a few milliseconds, the whole css rules are applied correctly. This delay is kind of visible by the user.

Please check the reproduce section.

Can you explain whether this is a bug from Primereact, or something wrong with NextJs, or is the intended behavior?

Thank you very much.
Regards

Reproducer

https://stackblitz.com/edit/stackblitz-starters-fkxhva?file=app%2Fpage.tsx

PrimeReact version

10.2.1

React version

18.x

Language

TypeScript

Build / Runtime

Next.js

Browser(s)

Any

Steps to reproduce the behavior

Please check the reproducer. In the reproducer, you can see a simple empty project with NextJS and Primereact; in the page, you can see a simple Button component with a custom width to highlight the label positioning delay (for example, this is the simplest example I can come with); the label should be centered in the button, however when the page reloads it is on the left; then quickly the correct css is applied, and you can see it even going to the center with an (unexpected) animation.

immagine
In the image, a screenshot of the label unexpectedly moving from left to center.

Expected behavior

The label should be centered all the times.

@gygabyte017 gygabyte017 added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Dec 17, 2023
@melloware
Copy link
Member

I think this is your issue? #5188

@melloware melloware added Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Dec 17, 2023
@melloware melloware closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Resolution: Duplicate Issue has already been reported or a pull request related to same issue has already been submitted
Projects
None yet
Development

No branches or pull requests

2 participants