My onKeyPress event code 13 stopped working

Dear all,

Our website was working fine, but recently
ALL input forms that relied on this code below
STOPPED WORKING upon “Enter” onKeyPress:

export function input1_keyPress(event, $w) {
if (event.code === 13 ){
search1();

Did something happen that changed this?
I’ll be grateful for help on this.

See the list of possible event properties: KeyboardEvent .

Here is how to check for user hitting “Enter”:

$w("#input").onKeyPress( (event) => {
    if(event.key === 'Enter') {
       // do stuff when user hits Enter
    }
} );

Thank you so much.

Just replacing this (event.code === 13 ) with (event.key === ‘Enter’) from your code, did the trick. It now works fine again.

The strange thing is that the previous code worked fine for more than a year, so I hope this one is not going to be deprecated too.

Thanks again Yisrael.