Opened 7 years ago
Closed 7 years ago
#42416 closed defect (bug) (fixed)
Code assumes iframe mode, exception in inline mode
Reported by: | programmin | Owned by: | westonruter |
---|---|---|---|
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)
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
7 years ago
#4
@
7 years 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
@
7 years 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.
This ticket was mentioned in Slack in #core by jeffpaul. View the logs.
7 years ago
#8
@
7 years 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.
#10
@
7 years 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
@
7 years ago
- Keywords has-patch added; needs-patch reporter-feedback removed
- Owner set to westonruter
- Status changed from new to assigned
#12
@
7 years 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.
@programmin can you provide an example for how inline mode could be forced the editor?