[vue] No `sizes` attribute set when using `preload="true"`
felixranesberger opened this issue · comments
Reproduction
<UnLazyImage
:src-set="sourceSet"
:placeholder-src="placeholderSrc"
:auto-sizes="true"
:width="image.width"
:height="image.height"
:alt="image.alt"
:title="image.title"
:preload="true"
class="u-object-cover"
/>
Describe the bug
When using :auto-sizes="true"
in conjunction with :preload="true"
the sizes attribute is not set.
This happens because UnLazyImage.vue
checks if props.preload === true
and uses the loadImage
method to load the image directly. But the loadImage
function is not checking, if the sizes
attribute should be calculated.
Additional context
No response
Logs
No response
Great catch! Thanks for the thorough bug report. Should be fixed in 6903fe8.
Thanks for the quick fix! 🎉