Skip to content

Conversation

@goldenapples
Copy link
Contributor

Shortcodes that contain floated elements break in preview because the iframe body collapses to zero height, leaving the floated element invisible.

This avoids that problem by using the display: inline-block / overflow: hidden on the body of the wpview iframe.

Addresses the problem discussed in #9.

Shortcodes that contain floated elements break in preview because the
iframe body collapses to zero height, leaving the floated element
invisible.

This avoids that problem by using the `display: inline-block` /
`overflow: hidden` on the body of the wpview iframe.
@goldenapples
Copy link
Contributor Author

@danielbachhuber thoughts on this, to solve the problem of floated elements in previews being cut off?

@danielbachhuber danielbachhuber added this to the v0.4.0 milestone May 6, 2015
@goldenapples
Copy link
Contributor Author

One thing that I think could be improved on is the width: 100%. I'm fairly sure that by making some creative use of width: fit-content on the body and html elements of the iframe, it should be possible to have inline or floated shortcodes, making the edit preview that much more useful. That probably needs some more work, though, to find the first element inside the iframe, check its float property, and apply that same float property to the wpview-body element surrounding it.

@danielbachhuber
Copy link
Contributor

thoughts on this, to solve the problem of floated elements in previews being cut off?

Seems like a reasonable approach to me. @mattheu ?

That probably needs some more work, though, to find the first element inside the iframe, check its float property, and apply that same float property to the wpview-body element surrounding it.

Related #317 (comment) and #169

I actually chatted with @gcorne (one of the original TinyMCE views authors) a bit today about this non-block element mess. It seems like it might be ripe for a solution :)

@danielbachhuber
Copy link
Contributor

This seems to work pretty well for our immediate needs.

danielbachhuber pushed a commit that referenced this pull request May 7, 2015
Force mce view sandbox to clear floated elements inside it
@danielbachhuber danielbachhuber merged commit 8fef356 into master May 7, 2015
@danielbachhuber danielbachhuber deleted the 9-clear-floats-in-mce-views branch May 7, 2015 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants