From 553c840ea79156d69ef78aa2879eee40700f122c Mon Sep 17 00:00:00 2001 From: jwollert Date: Fri, 2 Dec 2011 10:52:49 +0100 Subject: [PATCH] [#692] Chosen Patch: fixes result texts when searching. they broke when matching with several chars --- public/javascripts/chosen.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/javascripts/chosen.js b/public/javascripts/chosen.js index 733090b058..aff38f83bc 100644 --- a/public/javascripts/chosen.js +++ b/public/javascripts/chosen.js @@ -538,8 +538,8 @@ if (searchText.length) { startpos = option.html.search(zregex); text = $('
').html(option.html).text(); - text = text.substr(0, startpos + searchText.length) + '' + text.substr(startpos + searchText.length); - text = text.substr(0, startpos) + '' + text.substr(startpos); + text = text.substr(0, startpos + searchText.length) + text.substr(startpos + searchText.length); + text = text.substr(0, startpos) + text.substr(startpos); } else { text = option.html; }