-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Global Styles: Additional CSS button doesn't work on the second click #68949
Comments
Hi @t-hamano, I was able to reproduce the issue. The root cause was that the editor canvas view state wasn't being reset when navigating away from the CSS screen. I have implemented a fix. Please review it at your convenience. Thank You! |
@Infinite-Null Thanks for working on this issue.
In order to fix the problem rather than the symptom, we first need to determine why the canvas view is no longer resetting. One way to do this is to identify the pull request in which this issue occurred. I investigated the issue with I also looked at your PR (#68954), but resetting the view conditionally on a specific path may not be the best idea. Let's investigate the changes made in #65946, and the navigation logic, and investigate the root issue first. |
Hi @t-hamano, I've come up with a solution that handles the state reset. The issue occurred in the CSS screen component itself, where we weren't properly cleaning up the editor canvas view state when navigating back. The fix adds the state reset directly in the CSS screen's back button handler, ensuring the view state is cleaned up at the right moment. onBack={ () => {
setEditorCanvasContainerView( undefined );
} } Let me know if you'd like me to make any adjustments to this approach. |
I'm trying to solve this problem in #68956, but it's a bit tricky. The screens in the global styles sidebar are switched automatically via the Related to this issue, I found that accessing the CSS screen via the command palette also doesn't work in some cases. This command only switches the canvas view to 30b4d0557b8308529b1908df485c1bda.mp4I think we need to find a way to switch to the CSS screen from outside the Navigator component, regardless of the canvas view change. |
Description
Found in this comment: #68928 (comment)
This issue doesn't occur in WP 6.7 and can be reproduced in the latest Gutenberg.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
03535722f05de68d15a5d488e829c115.mp4
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Please confirm which theme type you used for testing.
The text was updated successfully, but these errors were encountered: