Reload page on click - repeaters with Buttons problem

Hello everyone, I have 5 repeaters which all get data from a database and everything works correctly. Thought the links on the database lead to the same page just with different filters, for example when a user clicks “Tshirts” it leads him to the Shop all page with filter “Tshirts” on etc.
The problem is that, if he decides to click from the menu another button lets say “Skirts” button and he is on the Shop All page, it just applies the next filter as intended BUT it does not collapse the menu strip ON CLICK, so the user has to use my mouseOut function to collapse it.
I have tried adding the onClick even on the buttons of the repeater but when I do that the link decides to diappear so I get the ERROR: that the link property is undefined.
How can i fix this please?

$w ( “#repeaterSubSub5” ). onItemReady (( $item , itemData , index ) => {
const repeaterButton = $item ( #buttonSubLevelTwo5 )
const repeaterImage = $item ( #rangeMenuImage1 );
//Set the item label.
repeaterImage.src = itemData.img ;
repeaterButton.label = itemData.label ;
repeaterButton.link = itemData.url ;
repeaterButton.target = “_self” ;
//repeaterButton.onClick((event) => {event.item.link; $w(‘#megaMenuStrip’).collapse();});

  });

Found an indirect solution as described on this post: How to detect if URL has changed after hash in JavaScript and using wixlocation to implement this