How to create a text field that turns into a "drop down text field" when the text is clicked?

I’m having trouble with
Im trying to create a text field using the “Collapsible text” feature to produce a 1 line element, where clicking the text expands the field, revealing more text.

The problem I run into is that I cant seem to only get it to show the expand/collapse button, and the text and the expand/collapse button doesn’t seem to be a feature.

I hope someone knows a workaround or some code for this issue.

do you have a screenshot ? may help us see what the issue is.

Yes ofc.

So what Im trying to do is to only have one line, which should function as a drop down feature. The two lines currently displayed are “text” and “expand button” respectively.

Might be a bad explanation, but I hope it makes a bit of sense.

I understand what you are trying to achieve now I think.

The collapsed text wont work in this situation. I would use a button. remove all backgrounds so it just looks like text. then add a container below with the text you need inside it. Set the container to be collapsed. then add some code to the button to expand and collase the container.

$w('#button1').onClick(() => {
    const box = $w('#box1');
    if (box.collapsed) {
        box.expand();
    } else {
        box.collapse();
    }
});

Recording 2025-09-03 082805

Lovely mate. Thx!

I’ll give it a shot and see if I can get it to work the way you describe it.