Open AaronMLB opened 2 years ago
Hi @dmanek; have you been able to look at this issue in the last few months? Can you provide any insight or recommendations? Thanks!
I have the same issue. amp-img elements delivered by xhr-response will be stripped of its layout attribute and are rendered as "fixed".
but since this is an open issue for quite some time now and no one is assigned, i guess i have to fall back to fixed-sized/centered images in combination with multiple viewports defined in the srcset attribute, but thats no clean solution and adds a lot of unnecessary code to our amp page.
Edit: when implementing the srcset solution i stumbled upon a possible solution. If the amp-img tag has a sizes attribute with a valid value, the layout attribute won't be omitted anymore. In my case i used sizes="100%".
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.
It would be nice to have this sorted at some point. It's not a non-issue, just has been ignored.
Description
I am rendering a page with some additional content coming in by XHR (via
amp-render
) depending on the user's level of permissions.Parsing this content with an
amp-mustache
template, everything works fine exceptamp-img
. These are delivered as a whole AMP HTML element and rendered (supposedly) directly through the mustache triple braces, except thelayout
attribute is being forcibly rewritten fromintrinsic
tofixed
, so the images are not scaling and correctly responsive for mobile devices.Reproduction Steps
The full template is as follows:
A typical question object from that JSON response is as follows:
However, the resulting
amp-img
element is rendered thus, fixed not intrinsic as specified:The
amp-render
being used is version 1.0, whilstamp-mustache
is 0.2.Relevant Logs
No response
Browser(s) Affected
No response
OS(s) Affected
No response
Device(s) Affected
No response
AMP Version Affected
2111060251009