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

Styles cause lag on Block insertion and selection #22823

Closed
getdave opened this issue Jun 2, 2020 · 4 comments
Closed

Styles cause lag on Block insertion and selection #22823

getdave opened this issue Jun 2, 2020 · 4 comments
Labels
[Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended

Comments

@getdave
Copy link
Contributor

getdave commented Jun 2, 2020

Describe the bug
Inserting the Navigation block causes a perceivable lag in the editor interface before the block appears and is useable. This also happens when re-selecting the block having focused elsewhere.

The culprit appears to be the Block styles. This is likely due to the perf costs of rendering the BlockPreview component.

To reproduce
Steps to reproduce the behavior:

  1. On master branch.
  2. Create Post
  3. Insert Nav Block
  4. See lag before you are able to interact with the block/editor again.
  5. Click away from Nav Block so it is no longer "focused".
  6. Click on Nav Block again to re-select it. Again, notice the lag before it becomes interactive.

Expected behavior
There should be no perceivable lag.

Screenshots
Here are some videos to illustrate the issue.

Editor version (please complete the following information):

  • WordPress version: [e.g: 5.5]: it's 5.5
  • Plugin
  • If the Gutenberg plugin is installed, which version is it? It's the version from master.

Desktop (please complete the following information):

  • OS: [e.g. iOS]: MacOS
  • Browser Chrome
  • Version [e.g. 22] 83

cc @draganescu

@getdave getdave added [Type] Bug An existing feature does not function as intended [Block] Navigation Affects the Navigation Block labels Jun 2, 2020
@draganescu
Copy link
Contributor

It is interesting to note if this is visible to other blocks as well.

@adamziel
Copy link
Contributor

adamziel commented Jun 3, 2020

Unfortunately I am unable to reproduce the visible lag. Still, the BlockPreview component is pretty slow indeed. Recently I added a memo() which helped avoid costly re-rendering (#21973) - I wonder if it's failing somehow and the component is getting rendered multiple times?

@draganescu
Copy link
Contributor

I will edit this issue to be more generic as Block styles, if the problem is observed consistently, are in all the blocks that support them, not just in navigation.

@draganescu draganescu added [Feature] Blocks Overall functionality of blocks and removed [Block] Navigation Affects the Navigation Block labels Jun 4, 2020
@draganescu draganescu changed the title Nav Block - styles cause lag on Block insertion and selection Styles cause lag on Block insertion and selection Jun 4, 2020
@getdave
Copy link
Contributor Author

getdave commented Jun 16, 2020

I'm going to close this as I can't reproduce in incognito mode so I think it must be one of my extensions.

@getdave getdave closed this as completed Jun 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants