From 1f7fe35cec6a223c28355fe906a5b4692c162ec0 Mon Sep 17 00:00:00 2001 From: Aaron van Geffen Date: Sun, 13 Nov 2016 22:57:19 +0100 Subject: [PATCH] Accept tags consisting of only two letters, too. --- controllers/ProvideAutoSuggest.php | 2 +- public/js/autosuggest.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/ProvideAutoSuggest.php b/controllers/ProvideAutoSuggest.php index 884e279..c0bd6a4 100644 --- a/controllers/ProvideAutoSuggest.php +++ b/controllers/ProvideAutoSuggest.php @@ -29,7 +29,7 @@ class ProvideAutoSuggest extends JSONController { $data = array_unique(explode(' ', urldecode($_REQUEST['data']))); $data = array_filter($data, function($item) { - return strlen($item) >= 3; + return strlen($item) >= 2; }); $this->payload = ['items' => []]; diff --git a/public/js/autosuggest.js b/public/js/autosuggest.js index 12a6ac0..9d6b6a3 100644 --- a/public/js/autosuggest.js +++ b/public/js/autosuggest.js @@ -69,7 +69,7 @@ AutoSuggest.prototype.onType = function(input, event) { } var tokens = input.value.split(/\s+/).filter(function(token) { - return token.length >= 3; + return token.length >= 2; }); if (tokens.length === 0) {