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

Block Editor: Device switching does not animate when editor is not iframed #56968

Open
t-hamano opened this issue Dec 12, 2023 · 0 comments
Open
Labels
[Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release

Comments

@t-hamano
Copy link
Contributor

Description

For example, if you enable custom fields in the preferences panel, the editor canvas will no longer be an iframe. On the other hand, if the device preview is tablet or mobile, the editor canvas will be rendered as an iframe. When switching from a device to a tablet or mobile preview, the expected animations are not applied.

From what I've researched, I think this issue is related to the introduction of the BlockCanvas component in #54149. In this component, the iframe editor canvas itself stretches and contracts via animation when the device type changes. However, if only the desktop preview view is not an iframe, the animation will be cut off.

Previously, there was a parent element of the editor canvas, and that element was animated. Therefore, I think that whether or not the editor canvas inside was iframed, the animation was not affected.

In the screencast below, you can see the inline style of the parent element of the editor canvas dynamically changing.

b469ad87d20186c49abd5e191ffcf235.mp4

Step-by-step reproduction instructions

  • Enable the custom fields from the Preferences panel.
  • Change the device type from the preview button.

Screenshots, screen recording, code snippet

d6e7a1dd8a6440b9a351da2488286756.mp4

Environment info

No response

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

@t-hamano t-hamano added [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release [Package] Block editor /packages/block-editor labels Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package] Block editor /packages/block-editor [Type] Bug An existing feature does not function as intended [Type] Regression Related to a regression in the latest release
Projects
None yet
Development

No branches or pull requests

1 participant