From 985dd2e82da384a96c028fffe723a2f096065ea1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Delobelle?= Date: Mon, 5 Sep 2016 20:35:45 +0200 Subject: [PATCH] =?UTF-8?q?Fix=20autocompl=C3=A9tion=20article=20K-Psul?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- kfet/templates/kfet/kpsul.html | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/kfet/templates/kfet/kpsul.html b/kfet/templates/kfet/kpsul.html index 95dbd208..eaaad49a 100644 --- a/kfet/templates/kfet/kpsul.html +++ b/kfet/templates/kfet/kpsul.html @@ -635,7 +635,9 @@ $(document).ready(function() { return false; } - articleSelect.on('keypress', function(e) { + articleSelect.on('keydown', function(e) { + console.log('trolo'); + console.log(e.charCode); var text = articleSelect.val(); // Comportement normal pour ces touches if (normalKeys.test(e.keyCode) || e.ctrlKey) { @@ -648,12 +650,10 @@ $(document).ready(function() { articleSelect.val(''); } return true; - } else if (e.charCode !== 0) { - if (updateMatchedArticles(text+e.key)) { - articleNb.val('1'); - articleNb.focus().select(); - } - return false; + } + if (updateMatchedArticles(text+e.key)) { + articleNb.val('1'); + articleNb.focus().select(); } return false; });