Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

IE/Performance: do not highlight letters when there are none to highl…

…ight
  • Loading branch information...
commit 88605f63f5553464274a54d496cc8fa62b179a62 1 parent f301289
@kneath authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/select_autocompleter.js
View
6 src/select_autocompleter.js
@@ -184,8 +184,10 @@ var SelectAutocompleter = new Class({
// Build a formatted string highlighting matches with <strong>
var formattedString = scoredTerm[1];
- var regexp = new RegExp("([" + regExpString + "])", "ig");
- formattedString = formattedString.replace(regexp, "<strong>$1</strong>");
+ if (filterValue.length > 0){
+ var regexp = new RegExp("([" + regExpString + "])", "ig");
+ formattedString = formattedString.replace(regexp, "<strong>$1</strong>");
+ }
// Build the template
var template = {
Please sign in to comment.
Something went wrong with that request. Please try again.