Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

- Fixed background image widget not visible.

## [2.2.0] - 2024-12-3

### Changed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "background-image-native",
"widgetName": "BackgroundImage",
"version": "2.3.0",
"version": "2.3.1",
"license": "Apache-2.0",
"repository": {
"type": "git",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,14 @@ export function BackgroundImage(props: BackgroundImageProps<BackgroundImageStyle
{ opacity, resizeMode }
] as StyleProp<SvgImageStyle>;

// When there's no content, allow container to grow to fill available space
// When there's content, size container to content
const containerStyle = props.content
? styles.container
: [styles.container, { flexGrow: 1, flexShrink: 1, flexBasis: "auto" as const }];

return (
<View style={styles.container} testID={name}>
<View style={containerStyle} testID={name}>
<Image source={image.value} style={imageStyle} color={styles.image.svgColor} testID={`${name}$image`} />
{props.content}
</View>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,16 @@ exports[`BackgroundImage renders with default styles 1`] = `

exports[`BackgroundImage renders without content 1`] = `
<View
style={{}}
style={
[
{},
{
"flexBasis": "auto",
"flexGrow": 1,
"flexShrink": 1,
},
]
}
testID="backgroundImageTest"
>
<Image
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8" ?>
<package xmlns="http://www.mendix.com/package/1.0/">
<clientModule name="BackgroundImage" version="2.3.0" xmlns="http://www.mendix.com/clientModule/1.0/">
<clientModule name="BackgroundImage" version="2.3.1" xmlns="http://www.mendix.com/clientModule/1.0/">
<widgetFiles>
<widgetFile path="BackgroundImage.xml" />
</widgetFiles>
Expand Down
Loading