I had a user input for user to input keyword for searching. When they click the search button, it works properly when the user press enter, but there is no response when the user click the Enter button.
Any help would be greatly appreciated!
Here is my code.
import { local } from 'wix-storage';
import wixLocation from 'wix-location';
function runSearch(){
let word = $w("#searchBar").value;
local.setItem("searchWord", word);
wixLocation.to(`/resultspage`);
}
$w.onReady(function () {
$w("#searchBar").onKeyPress( (event) => {
if(event.key === "Enter"){
runSearch();
}
})
});
export function vectorImage1_click(event) {
runSearch();
}