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
I did some debugging and found out the the issue is caused because the ImageBackground never receives a height correctly. Only through the source attribute which is not used for this component.
It needs to receive it via the style attribute, but that is never passed from any HTML code. At least I couldn't find a way to tell the img tag to have a proper height, neither through height attribute nor height style.
To illustrate the issue, below is some code that properly passes the imageHeight to the ImageBackground (node_modules/@shoutem/ui/html/components/Image.js).
let newProps = _.merge(this.props, {
style: {
width: imageWidth,
height: imageHeight
}
})
// Showing image as background, can't be opened (zoomed).
return (
<ImageBackground
{...newProps}
source={{ width: imageWidth, height: imageHeight, ...source }}
>
{children}
</ImageBackground>
);
In general it is an issue that I cannot pass a width or height, but 300px is hardcoded. The best solution would be if I the width/height passed to the img tag is used properly.
The text was updated successfully, but these errors were encountered:
We use the Html component in a custom extension which is based on the About extension.
The issue we face now for a while is that an image is not rendered if it is wrapped in an anchor:
I did some debugging and found out the the issue is caused because the
ImageBackground
never receives a height correctly. Only through the source attribute which is not used for this component.It needs to receive it via the style attribute, but that is never passed from any HTML code. At least I couldn't find a way to tell the
img
tag to have a proper height, neither through height attribute nor height style.To illustrate the issue, below is some code that properly passes the
imageHeight
to theImageBackground
(node_modules/@shoutem/ui/html/components/Image.js
).In general it is an issue that I cannot pass a width or height, but 300px is hardcoded. The best solution would be if I the width/height passed to the img tag is used properly.
The text was updated successfully, but these errors were encountered: