From bc63229ff68d3a01f165f3f467bb7b48f2517e20 Mon Sep 17 00:00:00 2001 From: Yair Even Or Date: Sat, 23 Nov 2024 20:06:51 +0700 Subject: [PATCH] #1409 - fixed incorrect example code --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b3bbf026..8e82596c 100644 --- a/README.md +++ b/README.md @@ -863,9 +863,9 @@ var formElm = document.forms[0]; // just an example tagify.on('keydown', onTagifyKeyDown) function onTagifyKeyDown(e){ - if( e.key == 'Enter' && // "enter" key pressed - !tagify.state.inputText && // assuming user is not in the middle or adding a tag - !tagify.state.editing // user not editing a tag + if( e.detail.event.key == 'Enter' && // "enter" key pressed + !tagify.state.inputText && // assuming user is not in the middle or adding a tag + !tagify.state.editing // user not editing a tag ){ setTimeout(() => formElm.submit()) // put some buffer to make sure tagify has done with whatever, to be on the safe-side }