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

Customize Widgets: Editor hides when selecting some blocks #62898

Closed
talldan opened this issue Jun 27, 2024 · 5 comments · Fixed by #62974
Closed

Customize Widgets: Editor hides when selecting some blocks #62898

talldan opened this issue Jun 27, 2024 · 5 comments · Fixed by #62974
Assignees
Labels
[Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. [Type] Bug An existing feature does not function as intended

Comments

@talldan
Copy link
Contributor

talldan commented Jun 27, 2024

Description

The customize widgets editor disappears leaving only a grey panel when selecting some blocks (paragraph works ok, blocks like image or latest posts cause an issue)

Step-by-step reproduction instructions

  1. Activate a classic theme like Twenty Twenty One
  2. Go to Customize > Widgets
  3. Select a non-paragraph block

Expected:
The block is selected and is still visible:
Screenshot 2024-06-27 at 12 18 12 pm

Actual:
The editor disappears like this:

Kapture.2024-06-27.at.12.19.38.mp4

Or maybe more like this:
homer disappear

Screenshots, screen recording, code snippet

No response

Environment info

It seems to only happen with the Gutenberg plugin active. It's ok when I check WP6.6

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 [Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. labels Jun 27, 2024
@andrewserong
Copy link
Contributor

I ran a git bisect which points to #61943 as the PR that introduced the regression in the widgets screen within the customizer.

From manually reverting part of that PR (just the addition of <StrictMode> in customize-widgets/src/index.js), I can get it working again locally.

@Mamaduka do you have an idea why the strict mode might affect this, and/or what a potential fix might be? I don't know much about strict mode, so that PR being the cause seemed a bit of a surprise to me!

@andrewserong
Copy link
Contributor

Also, I double-checked and #61943 wasn't included in WP 6.6, and this feature appears to be working fine in 6.6 RC 1, so it looks like it's just Gutenberg that's affected.

@talldan
Copy link
Contributor Author

talldan commented Jun 27, 2024

It's probably related to the way strict mode re-runs effects to find bugs - https://react.dev/reference/react/StrictMode#fixing-bugs-found-by-re-running-effects-in-development.

So there might be an effect that works ok when it's run once, but the second run causes this issue.

The good thing is that it won't be an issue for production versions of code.

@Mamaduka
Copy link
Member

Thanks for the ping!

Yeah, it's probably an effect or non-pure component issue, which StrictMode just highlighted. I fixed some bugs that the e2e tests caught.

I am assigning this to myself and will have a look later.

@Mamaduka Mamaduka self-assigned this Jun 27, 2024
@andrewserong
Copy link
Contributor

Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Widgets Customizer Ability to add and edit blocks in Customize → Widgets. [Type] Bug An existing feature does not function as intended
3 participants