From 0db845b1333caf0f74e1281a0d3980ecf248b15b Mon Sep 17 00:00:00 2001 From: Andrey Smakotin Date: Mon, 17 Nov 2025 16:36:38 +0300 Subject: [PATCH] Add minimum 3 character requirement for POS search --- myproject/pos/static/pos/js/terminal.js | 6 ++++++ myproject/pos/templates/pos/terminal.html | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/myproject/pos/static/pos/js/terminal.js b/myproject/pos/static/pos/js/terminal.js index 3f96fae..b9dd1d1 100644 --- a/myproject/pos/static/pos/js/terminal.js +++ b/myproject/pos/static/pos/js/terminal.js @@ -1038,6 +1038,12 @@ searchInput.addEventListener('input', (e) => { return; } + // Минимальная длина поиска — 3 символа + if (query.length < 3) { + // Не реагируем на ввод менее 3 символов + return; + } + // Для витрины — мгновенная клиентская фильтрация if (isShowcaseView) { renderProducts(); diff --git a/myproject/pos/templates/pos/terminal.html b/myproject/pos/templates/pos/terminal.html index ba75226..e4dba33 100644 --- a/myproject/pos/templates/pos/terminal.html +++ b/myproject/pos/templates/pos/terminal.html @@ -16,7 +16,7 @@
- +