Please add an event type: onCR, or onEnter

I just implemented a search against a database using the following:
import wixData from ‘wix-data’;

$w.onReady(function () {
//TODO: write your page related code here…
});
export function input1_keyPress(event, $w) {
wixData.query(‘CVOA-Magazines’)
.contains(‘article1’, $w(‘#input1’).value)
.or(wixData.query(‘CVOA-Magazines’).contains(‘article2’, $w(‘#input1’).value))
.or(wixData.query(‘CVOA-Magazines’).contains(‘article3’, $w(‘#input1’).value))
.or(wixData.query(‘CVOA-Magazines’).contains(‘article4’, $w(‘#input1’).value))
.find()
.then(res => {
$w(‘#table1’).rows = res.items;
});
}

It attempts the search with each press of a key, it would be better to wait for the carriage return/enter was hit before doing the search.

Thanks

Hey!
All you have to do is to add 1 more line :slight_smile:

 export function input1_keyPress(event, $w) { 
     if (event.key === "Enter") { 
           wixData.query//and the rest of your code

Thanks! Worked Like A Champ…