I've put together a working code setup for a wix dynamic page that runs through a repeater and filters for the text included in an input field. This is great barring for 1 quirk - after the timeout, the text input submits and you aren't able to carry on typing. I want the focus to remain on the input even after the timeout.
The relevant code is below - I've tried to retain the focus on the relevant input:
export function addressSearchBox_keyPress(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w('#addressSearchBox').value, lastFilterCity);
//logging output to console
console.log($w('#addressSearchBox').value);
//attempting to refocus to the addressSearchBox
$w("#addressSearchBox").focus();
}, 800);
}
Any idea on why this wouldn't work?