-
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
Blockeditor iFraming problems when switching Preview #52648
Comments
cc @ellatrix |
Thanks for the update @tellthemachines. I just linked this to #52640 |
I can confirm that #52640 removes those warnings when following the steps in this issue |
Thanks for your help! :)
Why is this expected behaviour? |
I just tested the Build from #52640 and can confirm that the error and warnings are fixed. One bug is still there though:
|
Howdy, @pg-greyd I wasn't able to reproduce the missing toolbar in a WP 6.3 Beta 4 + Gutenberg Nightly from today. (v-16.4.20230717) Would you mind double-checking on that as well? It doesn't seem to be related to this issue, but we also want to not have it fall through the cracks. |
Yes, I still have the toolbar issue with WP 6.3 Beta 4 + Gutenberg Nightly.
Seems to be related to #50378 |
Description
There seem to be some problems when switching the Blockeditor Preview which result from the new iFraming functions introduced in #50091 and #48286 .
When using WP 6.2.2 with Gutenberg 16.1.1 and original Twenty Twenty-Three Theme, everything works as expected. The Blockeditor is fully iFramed and no console warnings are shown.
According to #48286 the fully iFramed Editor is used when "all blocks are v3". However, by adding a single
add_meta_boxes
action (see snippet), the Editor is back its old behaviour with Tablet and Mobile previews in iFrames and Desktop without. From that point on, switching the preview to Tablet or Mobile shows console warnings from #50091 even with the Twenty Twenty-Three Theme (see gutenberg-16-bugreport-03.jpg). The actual problem occurs when switching back to Desktop while a block is selected. In that case, a fatal javascript error is thrown and the block is broken with the message "This block has encountered an error and cannot be previewed." (see gutenberg-16-bugreport-04.jpg).Firefox prints a bit more info in the console:
e.ownerDocument.defaultView is null
inwp/packages/block-editor/build-module/hooks/@wordpress/block-editor/src/hooks/padding.js:14
.As far a I understand, this happens because while switching the preview, the iFrame is destroyed to be replaced by the non-iFramed Desktop preview.
A secondary bug I noticed when making the screenshots:
In Tablet and Mobile preview, the Toolbar is missing.
Step-by-step reproduction instructions
e.ownerDocument.defaultView is null
Screenshots, screen recording, code snippet
snippet
gutenberg-16-bugreport-01.jpg
gutenberg-16-bugreport-02.jpg
gutenberg-16-bugreport-03.jpg
gutenberg-16-bugreport-04.jpg
Environment info
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
The text was updated successfully, but these errors were encountered: