Skip to content

Custom HTML block preview keeps expanding when iframe uses height:100vh #78539

@KeniVinh

Description

@KeniVinh

Description

I’m using the WordPress Custom HTML block to embed an iframe, for example:

<iframe src="https://www.photopea.com" style="width:100%; height:100vh; border:0;"></iframe>

The frontend displays normally, but in the block editor, the Custom HTML preview becomes very tall, shows a vertical scrollbar, and the editor becomes heavy. After saving/reopening the post, the block height seems to keep expanding.

Is there any way to disable the preview mode/review feature for the Custom HTML block, or prevent iframe content with height:100vh from being rendered in the editor preview?

Image

Step-by-step reproduction instructions

  1. Add a Custom HTML block.
  2. Click Edit HTML.
  3. Add an iframe in the HTML tab. The iframe uses height:100vh:

<iframe src="https://www.photopea.com" style="width:100%; height:100vh; border:0;"></iframe>

  1. Click Update.
  2. After updating, the Custom HTML block preview becomes very tall and shows a vertical scrollbar in the editor. The editor becomes heavy, even though the frontend page displays normally.

Screenshots, screen recording, code snippet

No response

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

Please confirm which theme type you used for testing.

  • Block
  • Classic
  • Hybrid (e.g. classic with theme.json)
  • Not sure

Metadata

Metadata

Assignees

Labels

[Block] HTMLAffects the the HTML Block[Status] In ProgressTracking issues with work in progress[Type] BugAn existing feature does not function as intended

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions