You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Having looked into the code, I can see that when MediaItem is provided, the height gets omitted and the code takes only the crops into account.
It applies height when providing src instead.
I think it would be great if height was used if provided. There could be a flag to say "ignore crops", but I think just the height being present could be used to tell the tag helper to respect it and ignore crops?
Note: not all sites even use crops - for example none of the sites I generally work on utilises this much, and we'd almost always want to use height to override crops when providing media-item, so it would be really useful to have the option. I will see if I can PR this change.
We're using
<our-img>
withmedia-item
and responsivewidth
s andheight
s.According to example 4 in the readme - the helper should output height attribute and in the
srcset
on<source>
tags.Our example code:
Output:
Expected:
We need slightly different aspect ratios based on screen size. Is it possible?
I think that height is missing from the output. Am I missing something or is this a defect?
appsettings.json:
The text was updated successfully, but these errors were encountered: