Opened 2 weeks ago
Last modified 5 days ago
#65328 accepted defect (bug)
editor-expand.js DFW button remnant causes intermittent TinyMCE editor height miscalculation in WordPress 7.0
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | Awaiting Review | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | TinyMCE | Keywords: | reporter-feedback |
| Focuses: | Cc: |
Description (last modified by )
Disclosure: This is an AI-assisted bug report. I've done my best to investigate its accuracy, but it's a bit out of my area of expertise. I used AI to help debug the problem that I noticed.
In WordPress 7.0, the Distraction Free Writing (DFW) button no longer appears in the TinyMCE toolbar, indicating the feature was removed or disabled. However,wp-admin/js/editor-expand.js still contains code that registers the DFW button with TinyMCE and immediately hides it during the editor init event:
editor.on( 'init', function() {
if ( button.disabled() ) {
button.hide();
}
} );
This button.hide() call triggers a TinyMCE reflow/repaint cycle (via theme.js) at a moment when the new React-based admin UI introduced in 7.0 has not finished laying out. The result is an incorrect height being stamped onto #mceu_31-body, causing the TinyMCE editor area to render with a large empty gray space.
The bug is intermittent because it is a race condition between React finishing its layout and TinyMCE firing init. It reproduces most reliably on a hard refresh (Shift+F5).
Steps to reproduce:
- Install WordPress 7.0
- Use the Classic Editor (either via the Classic Editor plugin or
add_filter( 'use_block_editor_for_post', '__return_false' )) - Open any post for editing
- Hard refresh (
Shift+F5) repeatedly until the bug appears
Expected result: TinyMCE editor renders at the correct height.
Actual result: #mceu_31-body receives an inflated inline height (e.g. 459.391px) while the inner #content_ifr iframe is a normal size, leaving a large gray gap.
Root cause: The DFW button registration and hide logic in editor-expand.js was not removed when DFW support was dropped in 7.0. Removing that block should resolve the issue.
Workaround: None confirmed beyond avoiding hard refreshes.
Attachments (2)
Change History (6)
#2
@
12 days ago
- Keywords reporter-feedback added
The DFW button wasn't removed in 7.0. While using the classic editor plugin on a stock version of WordPress, it appears as expected. See screenshot
I'm noticing that in your screenshot, you have a number of additional buttons that seem to be from plugins. Are you able to replicate this issue on a stock (no plugins and using a default theme) version of WordPress?
#3
@
5 days ago
The DFW button wasn't removed in 7.0.
The plot thickens! For me, on a brand new stock (LocalWP) instance of 7.0 with classic editor plugin, i do NOT get the distraction-free-writing icon. 😮
In looking further, I found this ticket https://core.trac.wordpress.org/ticket/62676 which feels incredibly related.
@joedolson - any luck investigating that ticket and seeing if it's related to this issue?

screenshot of overly large gray area in tinymce