[Solved] I need help showing and hiding an element inside a repeater

Context:
I have a box with a group of images in every instance in a repeater. I have a button in this box and I want to be able to click the button and hide the entire box in that specific repeater scope.

Problem:
For some reason it wont hide or show the element. I can change the text of an element without changing anything else. But it wont let me hide or show elements. Is there a solution?


export function closeBtn_click(event) {
const itemClicked = event.context.itemId;

   $w("#blurtsRepeater").forEachItem( ($item, itemData, index) => { 
        **if**  (itemData._id === itemClicked) { 
              
             $item("#panel01").hide;                            // <-- This line doesn't work 
             $item("#text87").text = "suck dick";          // <-- This line works 

             console.log("Success:", itemData); 
        } 
    } ); 

}


#show #hide #repeater #scoped #nested

hide returns a promise so you must write it like this

$item(" #panel01 ").hide();

Thank you for the reply. I tried to write it like that, but it still doesn’t work. I managed to fix it in a weird way though. Apparently it works if I write it like this:

$item(" #panel01 “).hide();
$item(” #panel01 ").expand();

I have no idea why. It wont work if I only have .hide() and it wont work if I only have .expand() but if I have both, it works… Not going to question it. lol

@samuelmorkbednarz thanks a lot for this hack. Great that the community works - if Wix doesn’t :confused: