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

Post editor has flash of unstyled content when loading #47724

Closed
talldan opened this issue Feb 3, 2023 · 8 comments
Closed

Post editor has flash of unstyled content when loading #47724

talldan opened this issue Feb 3, 2023 · 8 comments
Assignees
Labels
Needs Testing Needs further testing to be confirmed. [Package] Edit Post /packages/edit-post [Type] Bug An existing feature does not function as intended

Comments

@talldan
Copy link
Contributor

talldan commented Feb 3, 2023

Description

As the title says.

I think this issue is related to the iframed editor causing a delay when loading css, as I've noticed similar issues when working with iframes recently.

Step-by-step reproduction instructions

  1. Create a post with an empty group block and save it
  2. Reload the editor (you may need to disable caching or do a hard reload)
  3. With an eagle eye, notice that there' briefly a flash of unstyled content (the group block placeholder and the trailing block appender appear unstyled).

Screenshots, screen recording, code snippet

Kapture.2023-02-02.at.11.56.57.mp4

Environment info

Gutenberg trunk
Brave / Mac OS

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

@talldan talldan added [Type] Bug An existing feature does not function as intended [Package] Edit Post /packages/edit-post labels Feb 3, 2023
@youknowriad
Copy link
Contributor

cc @ellatrix as this might be related to the iframe.

@ellatrix
Copy link
Member

ellatrix commented Feb 6, 2023

This was supposed to be fixed by #46706, but it looks like it's regressed somehow? Even for an empty post, I'm seeing a flash of an unstyled inserter button and some focus styles.

@talldan
Copy link
Contributor Author

talldan commented Feb 7, 2023

@ellatrix I tried something out in #47808, and it seems to solve the issue, but I'm not sure if there are any problems with the way I fixed it.

I'll be AFK for a couple of weeks after today, so feel free to take over that PR, or tackle this in whatever way you want.

@ntsekouras
Copy link
Contributor

This issue happens in the iframed post editor and since we'll disable it for 6.2 #48076, I'll remove this issue from the respective board.

@ellatrix
Copy link
Member

@talldan I'm testing this again, but I can't reproduce when caching is enabled. Are you running this with Dev Tools open and cache disabled? In that case I can reproduce, but that's not normal usage.

@ellatrix ellatrix added the Needs Testing Needs further testing to be confirmed. label May 23, 2023
@talldan
Copy link
Contributor Author

talldan commented May 24, 2023

Yep, I am generally testing with dev tools open and cache disabled.

I don't think there should be a flash of unstyled content when there's an empty cache. Especially if it's something that can be fixed.

@ellatrix
Copy link
Member

ellatrix commented Jun 1, 2023

@talldan In theory, #51136 should have fixed it. Could you confirm? Reasoning: iframe is now initialised with the styles, and the load event should wait until all resources are loaded.

@talldan
Copy link
Contributor Author

talldan commented Jun 2, 2023

Yes, looks to be resolved now. I'll close this and the PR 👍

@talldan talldan closed this as completed Jun 2, 2023
@priethor priethor removed the [Status] In Progress Tracking issues with work in progress label Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Testing Needs further testing to be confirmed. [Package] Edit Post /packages/edit-post [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants