Help for codes, please

Hello.

This is my site : https://karalist2018.wixsite.com/listkara

On page “Liste des artistes”, my search bar works well
On page “Liste des titres”, my search bar don’t work… Why ? :stuck_out_tongue:

The code is :

import wixdata from "wix-data";
let lastFilterTitle;
let debounceTimer;
export function iTitle_keyPress(event, $w) {
if (debounceTimer) {
clearTimeout(debounceTimer);
debounceTimer = undefined;
}
debounceTimer = setTimeout(() => {
filter($w('#iTitle').value);  // input ID
}, 20);
}
function filter(title) {
if (lastFilterTitle !== title) {
wixdata.query("Titres")   // name of your database
.limit(20)
.contains('title', title)
.find()
.then(res => {
$w('#repeater3').data = res.items; // repeater ID
})
.catch( (error) => {
let errorMsg = error.message;
let code = error.code;
} );
lastFilterTitle = title;
}
}
 

Where am I wrong ?

Sorry for my english, i’m french

Thanks for help.

Is your code in the “Site” tab? And, is your search bar shown on all pages (using the switch in the toolbar)?

Make sure the keyPress listener is marked on the property panel of iTitle element.

Yes, it good now… Another question, when I do a search, I have the first 20 answers, but when I want to go to the second page, with my pagination bar, it cancels my request and returns to a normal display of my titles. How can I change this and have it show me the next 20 answers?