Opened 4 months ago
Closed 3 months ago
#42416 closed defect (bug) (fixed)
Code assumes iframe mode, exception in inline mode
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 4.9.2 | Priority: | normal |
| Severity: | normal | Version: | 4.9 |
| Component: | TinyMCE | Keywords: | has-patch commit fixed-major |
| Focuses: | javascript | Cc: |
Description
In 4.9 RC the editor has this in wp-includes/js/mce-view.js:
// Obtain the target width for the embed.
if ( self.editor ) {
maxwidth = self.editor.iframeElement.clientWidth - 20; // Minus the sum of horizontal margins and borders.
}
This should probably be editor.bodyElement when an editor is in [inline https://www.tinymce.com/docs/demo/inline/] mode not the iframed mode.
self.editor.iframeElement causes an exception.
Possibly somewhat related to https://core.trac.wordpress.org/ticket/28929 but I hadn't noticed that problem recently.
Attachments (1)
Change History (16)
#1
@westonruter
4 months ago
- Keywords needs-patch added
- Milestone changed from Awaiting Review to 4.9
#2
@westonruter
4 months ago
- Keywords reporter-feedback added
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
4 months ago
#4
@westonruter
4 months ago
I understand TinyMCE has an inline mode, but can TinyMCE _for the WP editor_ get the inline mode? Sample code to do this would be appreciated.
#5
@programmin
4 months ago
The Wordpress post editor on wp-admin is not the only place you can include the wp editor. When you use inline mode that js file causes exception and this started on 4.9 testing.
#6
@westonruter
4 months ago
@programmin Please provide some sample code for demonstrating this.
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
4 months ago
#8
@jbpaul17
4 months ago
- Milestone changed from 4.9 to 4.9.1
Per today's 4.9 bug scrub, we're punting this from 4.9 to 4.9.1 to allow for appropriate time for feedback/review/updates.
#9
@johnbillion
4 months ago
- Milestone changed from 4.9.1 to 4.9.2
#10
@aduth
3 months ago
This can be demonstrated in the Gutenberg editor, which uses inline mode for rendering TinyMCE, including the Classic Text block. The related issue has been reported here:
https://github.com/WordPress/gutenberg/issues/3568
The above patch changes the behavior to retrieve clientWidth from the body element, which supports both iframe and inline modes, and should recreate the expected behavior of assigning an embed maximum width corresponding to the available width of the editor body.
#11
@obenland
3 months ago
- Keywords has-patch added; needs-patch reporter-feedback removed
- Owner set to westonruter
- Status changed from new to assigned
#12
@westonruter
3 months ago
- Keywords commit added
- Status changed from assigned to accepted
With 42416.diff, embeds are appearing with the proper width in both the Text widget and the classic editor.
#13
@westonruter
3 months ago
- Resolution set to fixed
- Status changed from accepted to closed
In 42390:
#14
@westonruter
3 months ago
- Keywords fixed-major added
- Resolution fixed deleted
- Status changed from closed to reopened
#15
@westonruter
3 months ago
- Resolution set to fixed
- Status changed from reopened to closed
In 42391:
@programmin can you provide an example for how inline mode could be forced the editor?