In image settings you should have options like “fill”, “cover” etc. I don’t know if you tried them but they should fix it. I don’t mean the CSS editing, I’m referring to settings panel of images. (edit the first item’s image in the repeater)
All native images have this feature so even if you don’t see that you can use that feature via code add this line of code in your page to change the behavior for all images in that page:
$w("Image").fitMode = "fixedWidth";
The code above will effect all images and it may not the thing you are looking for so I’m not sure you can also replace “fixedWidth” from the options below:
fixedWidth
fit (this might be what you need)
fill
So try them and see if it’s working. Normally you should have these options in the settings panel of image element interesting that you don’t see them somehow…
function filterDataset(startDate, endDate) {
// Check if startDate and endDate are valid dates
if (startDate && endDate) {
// Filter dataset based on start date on or after the selected date
$w("#datasetEvents").setFilter(wixData.filter()
.ge("start", startDate) // "ge" means greater than or equal to
.le("start", endDate) // "le" means less than or equal to
.eq("status", 'SCHEDULED')
)
.then(() => {
if ($w("#datasetEvents").getTotalCount() === 0) {
// Dataset is empty
$w('#sectionEvents').collapse();
}
else {
// Dataset has data
$w('#sectionEvents').expand();
}
})
.then(() => {
$w("#repeaterToday").onItemReady(($item, itemData) => {
// Get the image element within the repeater item
const image = $item("#imageToday");
// Set the fit mode of the image to "fit"
image.fitMode = "fit";
});
})
.catch((err) => {
console.error("Error applying filter:", err);
});
} else {
console.error("Invalid startDate or endDate:", startDate, endDate);
}
}