From 9c9ebeecebb09e70064a30dc1430f17f65b29cba Mon Sep 17 00:00:00 2001 From: Eric Date: Fri, 16 Nov 2018 15:17:49 +0100 Subject: [PATCH] =?UTF-8?q?N=C2=B01763=20-=20Fix=20autocomplete=20and=20ac?= =?UTF-8?q?cents?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- js/jquery.autocomplete.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/js/jquery.autocomplete.js b/js/jquery.autocomplete.js index 7d33ddd82..860a2f647 100644 --- a/js/jquery.autocomplete.js +++ b/js/jquery.autocomplete.js @@ -473,13 +473,14 @@ function matchSubset(s, sub) { if (!options.matchCase) - s = s.toLowerCase(); + s = s.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, ""); + sub = sub.toLowerCase().normalize('NFD').replace(/[\u0300-\u036f]/g, ""); var i = s.indexOf(sub); - if (options.matchContains == "word"){ + if (options.matchContains === "word"){ i = s.toLowerCase().search("\\b" + sub.toLowerCase()); } - if (i == -1) return false; - return i == 0 || options.matchContains; + if (i === -1) return false; + return i === 0 || options.matchContains; }; function add(q, value) {