manifold icon indicating copy to clipboard operation
manifold copied to clipboard

Reader should prevent images from overflowing

Open jojokarlin opened this issue 6 years ago • 5 comments

Expected Behavior

In-text images should be sized on mobile.

Current Behavior

Image spills out right side of frame

Steps to Reproduce

  1. Open chapter titled "Three Problems with Observation" https://cuny.manifoldapp.org/read/untitled-adf23c4d-e786-432d-8851-659189f441f0/section/3719c151-752f-4ea3-a82d-82f010596a32

Context (Environment)

Reading the illustrated chapter from Structuring Equality on CUNY instance on mobile becomes a problem. Chapter was ingested from a single google doc via yml manifest.

jojokarlin avatar Sep 19 '18 15:09 jojokarlin

Calling this a bug. Will fix.

zdavis avatar Dec 06 '18 21:12 zdavis

This is a little more complicated than it first appears to be. The issue with the provided text is that there are height/width properties on the span tag wrapping the actual image. We have max-width: 100% on img tags currently.

One thing we could do is set a max-width: 100% property on everything on .manifold-text-section * as nothing should really be allowed outside the bounds of its parent all the way up to the reader container. I'm sure there are things I'm not thinking of that make that a sketchier fix though.

Screen Shot 2019-04-05 at 12 01 59 PM (3)

SMaxOwok avatar Apr 05 '19 19:04 SMaxOwok

Building on Max's comment, the height property on both the <span> and the <img> elements also needs to be overridden. So a minimal solution would be:

.manifold-text-section span {
  width: 100%;
  height: auto;
}

.manifold-text-section img {
  max-width: 100%;
  height: auto;
}

But targeting all <span> elements, or all descendants of .manifold-text-section, is bound to cause some regressions.

Do we have any additional control over how images are ingested from google docs?

dananjohnson avatar Aug 26 '19 16:08 dananjohnson

Bringing this back to life. We should be able to manipulate the DOM for images in google doc ingestions. @dananjohnson, if you can clarify what we'd need to change, I can have @scryptmouse take a stab at it.

zdavis avatar Feb 12 '20 21:02 zdavis

Thank you for taking the time to report this bug. We've reviewed the issue and agree that this should be fixed. We’re adding a “planned” label to indicate that we consider this bug as part of our current work plan.

This was an automated message, but please don't hesitate to reply. Our team watches these issues closely and will respond as soon as we're able to!

zdavis avatar Feb 12 '20 21:02 zdavis

Stale issue. Closing. Feel free to reopen if this continues to be an issue.

zdavis avatar Nov 17 '22 21:11 zdavis