Creating an expandable text box with a "show more..." in a Repeater

Hello Dainis

Here’s a code example to show more/less of a repeater text element:

let fullText; // variable to hold the full text
let shortText; // variable to hold the short version of the text

$w.onReady(function () {
 const shortTextLength = 40;
    fullText =  $w("#text1").text
    shortText = fullText.substr(0, shortTextLength) + "...";
    $w("#text1").text = shortText;
});

export function button1_click(event, $w) {
 if ($w("#text1").text === shortText) {
 // fullText = fullText.replace(' ', ' ');
        $w("#text1").text = fullText;
        $w("#button1").label = "Show Less";
    } else {
        $w("#text1").text = shortText;
        $w("#button1").label = "Show More";
    }
}


Good Luck!
Massa