Wix Gallery: Search Causing Gallery to Resize

Hello! I have been following the Wix tutorials. I have an image gallery linked to a Dataset that is displaying its items properly. I also have a search feature that filters the dataset using .contains (see below). Everything is working fine
UNTIL I apply a filter that causes the gallery to display nothing (i.e. I search for something that doesn’t exist in my Dataset). At this point, when I delete the filter word from the user input, my gallery will have resized itself. It stretches so far down that it takes a few seconds to scroll all the way down. Here’s a screenshot of what’s happening in preview.


Each of those orange colored strips are images that had square proportions initially. Here’s the code for the User Input and the function that sets the filter to the Dataset:

export function input1_keyPress(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}

debounceTimer = setTimeout(() =>{ 
	filter1($w("#input1").value); 
}, 200); 

}

let lastInput1;
function filter1(string) {
if (lastInput1 !== string) {
$w(“#heroData1”).setFilter(wixData.filter().contains(“title”, string));
lastInput1 = string;
//console.log($w(“#heroData1”).getTotalCount());
}
}

1 Like

Update: This issue did not occur when I changed the gallery design to Honeycomb (diamonds) or Honeycomb (hexagons). I haven’t tried each design yet, but the issue has occured for: Grid (floating), Grid (rounded), and Grid (Portrait).

Sounds like you found a solution. I recall this happening to me many months back, but I’ve since switched almost everything I can to repeaters, since they’re much more versatile. If it still persists id consider making a repeater appear as if it is just a gallery.