Hi, I have coded a function on a dynamic page on editor that allows users to search for a name on someones profile card which is linked to a collection. We want to allow users to search for a specific name instead of all profiles so have made the repeater collapsed until name is searched. The problem I’m facing now is on the search, it flashes all the members before showing the specific profile. I have tried reducing and increasing the debounce timer but not really sure what else I need to do. Can someone help me with the code please?
Here is the code:
import wixData from 'wix-data';
let debounceTimer;
export function searchQueryInput_keyPress(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
( $w("#SellerlistRepeater").collapsed )
}
debounceTimer = setTimeout(() => {
filter($w('#searchQueryInput').value);
}, 600);
}
let lastFilterTitle;
function filter(title) {
$w('#bioMSSellerDataset').setFilter(wixData.filter().contains('title', title));
lastFilterTitle = title;
$w("#SellerlistRepeater").expand(); }