Skip to content

Custom HTML: Fix scrollbar becoming non-functional after switching tabs#78571

Open
Mustafabharmal wants to merge 1 commit into
WordPress:trunkfrom
Mustafabharmal:fix/html-modal-scrollbar-tab-switch
Open

Custom HTML: Fix scrollbar becoming non-functional after switching tabs#78571
Mustafabharmal wants to merge 1 commit into
WordPress:trunkfrom
Mustafabharmal:fix/html-modal-scrollbar-tab-switch

Conversation

@Mustafabharmal
Copy link
Copy Markdown
Contributor

What?

Fixes a Custom HTML modal issue where the editor scrollbar can become non-functional after switching between HTML/CSS/JS tabs.

Closes #78545

Why?

Autosize initialization may run while the tab panel is not fully visible during tab transitions, leading to an incorrect initial size and broken scrolling behavior until another input event occurs.

How?

Use PlainText async autosize mode for the three tab editors (HTML, CSS, JS).
This defers initial autosize execution until after tab visibility updates complete.

Testing Instructions

  1. Insert a Custom HTML block.
  2. Open the Edit HTML modal.
  3. Add enough content in HTML so vertical scrolling is needed.
  4. Confirm scrollbar works in HTML.
  5. Switch to CSS and JS tabs (for users with unfiltered HTML capability), then back to HTML.
  6. Verify scrollbar remains functional immediately after each tab switch.
  7. Verify no extra input (for example, typing a space) is required to re-enable scrolling.

Screenshots or screencast

Before:

Before.HTML.block.Fix.mov

After:

After.HTML.block.Fix.mov

@github-actions
Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

1 similar comment
@github-actions
Copy link
Copy Markdown

Warning: Type of PR label mismatch

To merge this PR, it requires exactly 1 label indicating the type of PR. Other labels are optional and not being checked here.

  • Required label: Any label starting with [Type].
  • Labels found: .

Read more about Type labels in Gutenberg. Don't worry if you don't have the required permissions to add labels; the PR reviewer should be able to help with the task.

@github-actions github-actions Bot added the [Package] Block library /packages/block-library label May 22, 2026
@github-actions
Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Unlinked Accounts

The following contributors have not linked their GitHub and WordPress.org accounts: @at-ric.

Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Unlinked contributors: at-ric.

Co-authored-by: Mustafabharmal <mustafabharmal@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Package] Block library /packages/block-library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Custom HTML block -> scrollbar becomes non-functional after changing tabs (HTML,CSS,JS)

1 participant