Make WordPress Core

Opened 12 years ago

Closed 11 years ago

Last modified 11 years ago

#31253 closed defect (bug) (fixed)

Images should be forced to fit inside the editor

Reported by: iseulde Owned by: iseulde
Priority: normal Milestone: 4.3
Component: TinyMCE Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description (last modified by iseulde)

I think it would be best if images and captions have a max-width: 100%;.

This appeared to be a bit of a problem on iOS... Another bug, again.
Inside iframes, Safari on iOS doesn't obey max-width if a width is set on the element. It does work if a width attribute is used though. The only solution seems to be overwriting with width: auto;.

Related:

#24968
$content_width not constraining images in fullscreen editor
#30696
Inline media toolbar positioning
#31250
Twenty Fifteen editor styles look weird on mobile


Attachments (4)

image.jpg (82.9 KB ) - added by iseulde 12 years ago.
31253.patch (773 bytes ) - added by iseulde 12 years ago.
31253.2.patch (801 bytes ) - added by iseulde 12 years ago.
31253.3.patch (589 bytes ) - added by iseulde 11 years ago.

Download all attachments as: .zip

Change History (13)

@iseulde
12 years ago

@iseulde
12 years ago

#1 @iseulde
12 years ago

  • Keywords has-patch added
  • Milestone Awaiting Review4.2

@iseulde
12 years ago

#2 @iseulde
12 years ago

Forgot height: auto; :)
The only (minor) issue here is that some themes add a margin to images inside captions, so the image might overflow the caption area. Themes should add padding to the parent element instead. We should adjust our bundled themes.

#3 @iseulde
12 years ago

  • Description modified (diff)

This ticket was mentioned in Slack in #core by drew. View the logs.


12 years ago

#5 @DrewAPicture
12 years ago

  • Owner set to azaozz
  • Status newreviewing

As I recall, the Press This folks ran into the same issue with media overflowing the editor viewport. If we could, I'd like get insight from @azaozz on how they decided to handle that.

I think the issue is partially that $content_width defines the width as part of or in conjunction with themes' editor stylesheets, so would artificially constraining media to visible in the editor viewport mess too much with that?

#6 @iseulde
11 years ago

I think the issue is partially that $content_width defines the width as part of or in conjunction with themes' editor stylesheets, so would artificially constraining media to visible in the editor viewport mess too much with that?

No, width 100% obeys the width of the body.

An argument against doing this is that the theme might not set this on the front end and surprise the user. I still think we should do this because

1) most themes do force the image to fit on the front end and forget to do this in the editor (even our default themes before [31849]),
2) it's a really bad writing experience,
3) the theme does not need to provide any styles, so the defaults should be good, and
4) the editor can be used for things other than the post content.

Last edited 11 years ago by iseulde (previous) (diff)

#7 @DrewAPicture
11 years ago

  • Milestone 4.2Future Release
  • Owner azaozz removed

I don't think there's enough of a justification to make this kind of change at this point in the cycle. I think we need to fall back and get more discussion on the expected behavior here before we can really talk about implementing such a change. Punting.

@iseulde
11 years ago

#8 @iseulde
11 years ago

  • Owner set to iseulde
  • Resolutionfixed
  • Status reviewingclosed

In 33417:

Editor: fit images

Fixes #31253.

#9 @iseulde
11 years ago

  • Milestone Future Release4.3
Note: See TracTickets for help on using tickets.