fix takepos console error (#34709)

* fix console error

* exit early

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
Francis Appels
2025-07-10 16:45:26 +02:00
committed by GitHub
parent 94abc07a1f
commit 6e96cd2118

View File

@@ -711,7 +711,15 @@ function New() {
* return void
*/
function Search2(keyCodeForEnter, moreorless) {
var eventKeyCode = window.event.keyCode;
var eventKeyCode = null;
if (window.event && window.event.keyCode) {
eventKeyCode = window.event.keyCode;
}
if (eventKeyCode === null && keyCodeForEnter !== '') {
// No key code available, exit early if a key code is required
return;
}
console.log("Search2 Call ajax search to replace products keyCodeForEnter="+keyCodeForEnter+", eventKeyCode="+eventKeyCode);