I’m creating and expandable text box on my website following the directions here: https://support.wix.com/en/article/creating-an-expandable-text-box-with-a-show-more-link-using-wix-code
The “Show more” button does not relocate to the bottom of the text box when the character limit is set when the page loads. Basically the button stays in its set spot even though its connected to the bottom left corner of the text box.
Here is the full code I’m using:
let fullText;
let shortText;
$w.onReady( function () {
const shortTextLength = 40;
fullText = $w(“#text28”).text;
shortText = fullText.substr(0, shortTextLength) + “…”;
$w(“#text28”).text = shortText;
});
export function button1_click(event, $w) {
if ($w(“#text28”).text === shortText) {
$w(“#text28”).text = fullText;
$w(“#button1”).label = “Show less”;
} else {
$w(“#text28”).text = shortText;
$w(“#button1”).label = “Show more”;
}
}