And…I also found a solution to use with the standard repeater with the help of Chat GPT (without using multi state boxes). The code for it looks like this.
$w.onReady(function () {
$w(“#repeater1”).onItemReady(($item, itemData, index) => {
let isExpanded = false;
$item(“#boxElement”).collapse();
$item(“#collapseButton”).hide();
$item(“#expandButton”).show();
$item(“#expandButton”).onClick(() => {
if (!isExpanded) {
$item(“#boxElement”).expand();
$item(“#collapseButton”).show();
$item(“#expandButton”).hide();
isExpanded = true;
}
});
$item(“#collapseButton”).onClick(() => {
if (isExpanded) {
$item(“#boxElement”).collapse();
$item(“#collapseButton”).hide();
$item(“#expandButton”).show();
isExpanded = false;
}
});
});
});
It works well and the only little flaw that probably could be fixed with the multi state box, is that after closing the box, the viewport doesn’t move back to the repeater element, that was interacted with, but stays and one would have to scroll back up.