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

Helllo

here’s the steps of doing it:

  • add a repeater
  • in the repeater item add the text box and the button
    -define the values on ready
  • add on button click event
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("#text3").text //or whaterver text you want
    shortText = fullText.substr(0, shortTextLength) + "...";
    $w("#text3").text = shortText;
});

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

Good Luck
Massa